Flash sale. Your event queue is 95% full. What do you drop?
transcript
Flash sale. Your event collector's queue is 95 percent full. Something has to go. What do you drop?
First line: rate limits. 1,000 events a second per client. And 50,000 a second overall. Events wait in memory, up to 100,000. At 50,000, a warning. Past 90 percent full, it starts shedding.
The tempting answer: shed every event type equally. Fair, right? Then a payment is as likely to vanish as a page view.
So it doesn't shed blindly. Page views go first. Then product views, and performance telemetry. Orders, payments and sign-ups? Never shed.
Losing a few page views is fine. Losing revenue events is not.
Only when the queue is truly full is an event rejected. Everything else lands in Kafka. And Kafka buffers too. Consumers fall behind? Lag grows. But nothing is lost.
So under load, don't just ask how many to drop. Ask which ones. Shed telemetry. Always accept orders and payments.
Full breakdown in the lecture.