Wall 2: Submission floods near deadlines
Wall two is login storm's evil twin. Same synchronization, much higher stakes. An assignment is due at midnight, and human nature being what it is, a huge share of students submit in the final ten minutes. An exam ends at 11:00am and everyone hits submit at 10:59. The difference from a login is that a submission is not a quick token check. It is a heavy write: a file upload, answers persisted, a timestamp that has academic and sometimes legal weight, often a trigger for grading or plagiarism checks. And unlike a failed login, a dropped submission is not an annoyance. It is a student who did the work and has no proof, and a support escalation that goes all the way up.
If your API writes submissions straight to the database in the request, this wall is unforgiving. The synchronous path means the student's browser is holding the connection open while you write the file, write the record, maybe kick off processing, all before you can return a 200. Under a deadline flood those long-held connections exhaust the pool, write latency climbs, and some requests time out. The cruel part is that a timeout at the worst possible second looks, to the student, exactly like a lost submission. They refresh, resubmit, and now you have duplicates on top of an overloaded system.
The fix is to stop treating submission and processing as the same step. Put a durable queue between them. When a submission arrives, you do the smallest possible durable thing: persist the raw payload (or a pointer to the uploaded file in object storage) and enqueue a message, then return success immediately. The student gets their confirmation in well under a second because you are not making them wait on grading or virus scanning or anything else. Workers drain the queue at whatever steady rate the system can actually sustain, so a ten-minute flood becomes a flood into the queue and a calm, even trickle into the heavy processing behind it. The spike is absorbed instead of fought.
Two things make this trustworthy rather than just fast.
Idempotency: give every submission a client-generated key so a nervous resubmit or a retried request collapses to one record instead of three. And
guaranteed delivery: the queue has to persist messages and the workers have to acknowledge only after the work is genuinely done, so a worker crashing mid-grade redelivers the job rather than silently dropping a student's exam. The honest trade-off is that processing becomes eventually-consistent. The grade is not instant. For a deadline submission that is exactly the right call, because
received and safe matters far more than
graded this millisecond. We go through the delivery guarantees, the dead-letter handling, and the duplicate-collapse logic in
the submission queue architecture deep-dive.