Three ways to deliver server-pushed updates; pick based on direction, scale, and infra constraints.
Plain English: how do you let the SERVER push something to the browser (instead of the browser asking repeatedly)? Three answers: poll often (simple, wasteful), keep a one-way pipe open (SSE), or open a two-way pipe (WebSocket). Each has its place.
Three techniques for server-to-client updates over HTTP: long-polling (client opens a request, server holds it until data is ready, then closes), WebSockets (bidirectional persistent TCP connection upgraded from HTTP), Server-Sent Events (one-way HTTP stream from server to client over a single long connection).
HTTP is request-response, so the client has to ask. For 'tell me when something happens' use cases (chat messages, notifications, live updates), you need a way for the server to push.
Long-polling: client makes a request, server holds it (up to ~30s) until data appears or it times out, then client reconnects. WebSockets: HTTP upgrade handshake, then a persistent TCP connection both sides can write to. SSE: server holds a single HTTP response open and writes events to it, giving a one-way, simple stream with auto-reconnect built-in.
WebSockets: bidirectional, low-latency message delivery
WebSockets via the gateway tier; pub/sub for cross-box fanout
Long-polling for sync notifications, which works through every corporate firewall