Real Time Updates medium
You enable `permessage-deflate` (Compression) on your WebSocket server. Bandwidth usage drops by 50%. What is the trade-off?
- A Higher latency due to buffering.
- B Incompatibility with SSL.
- C Significant increase in CPU usage on both Client and Server to compress/decompress frames.
- D Messages are lost more often.
Answer: C. Significant increase in CPU usage on both Client and Server to compress/decompress frames.
Compression is a CPU vs. Bandwidth trade-off. For high-throughput servers, the CPU cost of zipping every single message can become the bottleneck, limiting the max concurrent connections.
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?