Which statement correctly describes how connections behave in Long Polling compared to Server-Sent Events (SSE)?
Think about how the client waits for messages in each method.
Long Polling involves the client sending a request and the server holding it until data is available, then closing the connection. The client then immediately sends a new request. SSE keeps one connection open continuously, streaming data as it arrives.
You are designing a live sports score update system for mobile and desktop browsers. Which architecture choice is best to minimize server load and provide near real-time updates?
Consider connection persistence and server resource usage.
SSE keeps one open connection per client, reducing overhead compared to Long Polling's repeated connections. Frequent short polling increases server load. WebSockets are an alternative but not part of this question.
What is the main scaling challenge when using Long Polling for thousands of simultaneous users?
Think about what happens each time a Long Polling request completes.
Long Polling repeatedly opens and closes HTTP connections, which causes CPU and network overhead. Maintaining persistent connections is a challenge for WebSockets or SSE, not Long Polling.
Which tradeoff best describes the choice between Server-Sent Events and Long Polling?
Consider browser support and server resource usage.
Long Polling works on all browsers but causes repeated connection overhead. SSE is simpler on the server side with a single connection but has limited support on older browsers. SSE is unidirectional; bidirectional requires WebSockets.
You plan to support 10,000 simultaneous clients using Server-Sent Events. Each client keeps one open HTTP connection. Estimate the main server resource bottleneck and the best approach to handle it.
Think about what keeping many open connections requires from the operating system.
Each open connection uses memory and a file descriptor. Handling 10,000 connections requires an event-driven server model and increasing OS limits for open files. CPU and network are important but less critical bottlenecks here.