Push vs Pull — How Real-Time Systems Deliver Data
### HTTP Pull Model
The Pull model means the client must ask for data every time. Each response requires a request, and continuous polling increases bandwidth usage significantly.
Example flow: - Client → Request → Server - Client → Request → Server - Client → Request → Server
This approach is inefficient for real-time data.
### HTTP Push Model
In the Push model, the client requests once, and the server sends updates continuously as they become available. This is heavily used in use-cases like real-time notifications.
Technologies used: - AJAX Long Polling - WebSockets - HTML5 Server-Sent Events (Event Source) - Message Queues - Streaming over HTTP
### AJAX Long Polling
In Long Polling, the client sends a request, but the server holds the request until new data is available. Once data is available, it responds, and the client immediately reconnects. This is often used in older chat apps and notification systems.
### Time To Live (TTL)
TTL determines how long a connection remains active before timing out. A typical TTL for long polling might be 30 to 60 seconds.
