A queue for notifications
Statement
A notification service: normally 600 requests/s, half of them writes. Once a day traffic grows 6× for 20 seconds (a push campaign): 1800 writes per second, i.e. 5400 database units — no tier takes that. Route the writes through a message queue: users get an instant reply and workers drain the queue into the database at 200 messages/s per instance. Mind two things: the queue must be empty by the end of the scenario, and workers must not write faster than the database can absorb.
Constraints
- p95 ≤ 250 ms, errors ≤ 0.1 %, queue empty by the end, budget $2800/month, ≤ 5 instances per node.