Member-only story
System Design Fundamentals
Not a member? Read here.
Polling and Webhooks deal with same purpose, that is for retrieving updates from a server.
Polling
This is a technique where the client periodically sends requests to the server to check for updates or new data.
Key characteristics:
- Client-initiated: The client makes regular requests at fixed intervals
- Simple to implement: Easy to set up on the client side
- Inefficient: Can generate unnecessary traffic and server load if there are no updates
- Delayed updates: There’s always a lag between an update occurring and the client receiving it
Use polling when:
- Real-time updates aren’t critical
- The data source updates very frequently
- You need a simple implementation
- The API doesn’t support webhooks
Webhooks
Webhooks, also known as reverse APIs, allow the server to send real-time notifications to the client when specific events occur.
Key characteristics:
- Server-initiated: The server pushes data to the client when there’s an update