Real Time Updates hard
Your WebSocket server crashes and restarts. 100,000 clients attempt to reconnect immediately. This DDOS-es your auth service and crashes the server again. What is the standard mitigation?
- A Exponential Backoff with Jitter.
- B Increase the server RAM.
- C Use UDP.
- D Disable authentication on reconnect.
Answer: A. Exponential Backoff with Jitter.
If everyone retries at exactly `T+1s`, `T+2s`, `T+4s`, the waves of traffic will still crush the server. Jitter adds randomness (`T + 1s + random(0-500ms)`), desynchronizing the clients so the load is spread out over time.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When a mobile app is closed/backgrounded, it cannot keep a WebSocket open. How does it receive real-time alerts (like 'New Message')?
- For a human user, what is generally considered the maximum acceptable latency for an interaction to feel 'Real-Time' (e.g., typing in a Google Doc)?
- If you want to update a news feed on a website every time a new article is published, what is the simplest (but least efficient) 'Real-Time' technique?
- In a persistent real-time connection, what is the purpose of a 'Heartbeat' or 'Ping/Pong' message?
- Why is Short Polling considered 'Chatty'?
- Server-Sent Events (SSE) are ideal for which type of real-time application?