DEV Community

Dinesh Babu
Dinesh Babu

Posted on

Session 5 summary

Today I learnt about short polling, long polling and server side events from the system design class.

1. Short polling: The client sends requests at timed intervals to the server to get the information. For example, we could set the interval as 5 seconds and the request is sent from the client every 5 seconds to check if the requested data is actually available from the server.

2. Long polling: The client sends a request to the server and the server holds the requests until the requested data is available. It is bound to using server resources more and many connections are wasted.

3. Server-side events: This is the method whereby the server sends data in regular intervals. In javascript, we can use the EventResource object that creates a connection between the server and the client and at constant intervals, data is sent from the server to the client.

Top comments (0)