Grokking the System Design Interview

0% completed

Long-Polling vs WebSockets vs Server-Sent Events

Long-Polling, WebSockets, and Server-Sent Events are popular communication protocols between a client like a web browser and a web server. First, let’s start with understanding what a standard HTTP web request looks like. Following are a sequence of events for regular HTTP request:

  1. The client opens a connection and requests data from the server.
  2. The server calculates the response.
  3. The server sends the response back to the client on the opened request.

Ajax Polling

Polling is a standard technique used by the vast majority of AJAX applications

.....

.....

.....

Like the course? Get enrolled and start learning!
P

pushkar312

· 3 years ago

It would be more beneficial for the readers to add any real-world examples for each concept. For examples ride sharing apps vs chat application like WhatsApp etc.

D

dev.interview.93

· 2 years ago

Added diagrams are irrelevant and serve no purpose in understanding

T

thomhickey

· a year ago

Does anyone really call them ajax requests anymore?

Andre Hildinger

Andre Hildinger

· 4 months ago

"Polling is a standard technique used by the vast majority of AJAX applications"

I don't think this is true at all.

Most web applications don't perform any polling or other continuous data-receiving tasks. They are mostly reactive apps. User does something; a request is sent; the browser/JS code acts on the response; the end.

E

E

· 4 years ago

On #3. "The server sends... on the open request". This should be connection, right?