Real Time Updates easy
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?
- A Short Polling (The client asks 'Anything new?' every 5 seconds).
- B WebSockets.
- C Server-Sent Events.
- D Message Queues.
Answer: A. Short Polling (The client asks 'Anything new?' every 5 seconds).
Short Polling is the easiest to implement because it uses standard HTTP requests. However, it is inefficient because most requests return 'No new data', wasting bandwidth and server resources.
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)?
- 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?
- What is the primary advantage of using a WebSocket over standard HTTP for a chat application?