Decision guide
Polling vs Webhooks (vs Streaming)
How should clients learn that something changed on your server?
Side by side
| Criterion | Polling | Webhooks | Streaming (SSE/WebSockets) |
|---|---|---|---|
| Latency | Poll interval | Seconds | Sub-second |
| Consumer requirements | HTTP client only | Public HTTPS endpoint + signature verification | Persistent connection handling |
| Delivery guarantees | Client controls | Provider retries; consumer dedupes | Reconnect + resync needed |
| Provider cost | Wasted requests | Retry queues, delivery logs | Connection management |
| Missed-event recovery | Natural | Retries + events API for backfill | Resync on reconnect |
| Security | Standard auth | HMAC signatures, SSRF-safe delivery | Auth on connect, per-event authz |
When to choose each
Polling
Clients periodically call GET (ideally with ETags / updated_since).
Choose when
- Simple integrations
- Clients behind firewalls (no public endpoint)
- Low change frequency
Avoid when
- Near-real-time needs at scale
- Many clients polling frequently
Webhooks
Server POSTs signed events to a URL registered by the consumer.
Choose when
- Server-to-server integrations
- Event-driven workflows (payments, shipping)
- Avoiding wasted polling
Avoid when
- Consumers without public HTTPS endpoints
- Browser/mobile clients
Streaming (SSE/WebSockets)
Persistent connection pushing events.
Choose when
- Browser/app UIs needing instant updates
- High-frequency updates
Avoid when
- Server-to-server integrations (connections must be kept alive)
Verdict
For server-to-server integrations, offer webhooks plus a list/events endpoint for backfill and reconciliation (webhooks can be missed). Use streaming for interactive UIs and polling as the universal fallback.
Learn more
- API Architecture and Integration Design
- REST APIs in Depth
- API Design
- Messaging & Queues
- Verify incoming webhooks in FastAPI (FastAPI)
- Receive and verify webhooks in PHP (PHP)