- Message queue Your process flow sounds like its main goal.
- Clustering / load balancing.
- Optimize Your Code
The first thing I would do is queue for notifications. Then I would queue all database records that should not return a value. Then I will look at scaling.
Other considerations: * Avoid a large clumsy structure that does more work behind than the scene than you probably need. * Use cache and static variables whenever possible.
40 000 , IO , . . , , ( ) .
Edit:
. . , . . , .