polling pattern
Client asks the server for new data on a regular interval. Simple, robust, debuggable — but wastes calls when nothing has changed and is slow when something has.
Client asks the server for new data on a regular interval. Simple, robust, debuggable — but wastes calls when nothing has changed and is slow when something has.
symptoms
- lots of empty responses
- lag between event and detection
- API rate limits eaten by polling
causes
- no push channel available
- operational simplicity preference
fixes
- long-polling for lower latency
- webhooks if server can push
- server-sent events / WebSocket for streaming
you might say
- just poll for it
- we'll poll every 30s