Polling vs Webhooks
Pull updates on a schedule, or have events pushed to you — each has clear trade-offs.
What you'll learn
- Describe how polling and webhooks deliver updates
- Weigh latency, load and complexity for each
- Choose the right model for a given update pattern
- Handle missed or duplicate webhook deliveries
- Use polling as a reliable fallback
6 min
How polling works
Polling means your client asks has anything changed? on a regular schedule. You control the timing and the pace, which makes polling simple and predictable. There is no inbound endpoint to expose and no signature to verify.
The downsides are latency and waste. You only learn about a change at the next poll, so updates arrive late. And most polls return nothing, spending requests and rate-limit budget to discover that nothing happened. Polling fits low-frequency or non-urgent updates, and situations where you cannot accept inbound traffic. Tune the interval to balance freshness against cost — too frequent wastes quota, too rare feels stale.
How webhooks work
A webhook reverses the direction: the provider calls your endpoint when something happens. Updates arrive promptly and you make no wasted calls. This is efficient and low-latency, which suits frequent or time-sensitive events.
The cost is operational. You must expose a public, secure endpoint that is always available, verify that each delivery is genuine, and respond quickly so the sender does not time out. If your endpoint is down, you may miss deliveries unless the provider retries. Webhooks trade the simplicity of polling for immediacy, and they put reliability requirements on infrastructure you own.
Receiving webhooks safely
A robust webhook receiver follows a few rules:
- Verify authenticity — check the signature so you only act on genuine deliveries.
- Acknowledge fast — return 2xx immediately, then process the work out of band.
- Be idempotent — the same event may arrive twice, so deduplicate by event identifier.
- Handle out-of-order arrival — do not assume events come in sequence.
Returning quickly is important: heavy processing inside the request risks a timeout, which makes the sender think delivery failed and retry. The usual shape is to validate and persist the event fast, then hand the real work to a background queue. See the idempotent consumer for deduplication.
Belt and braces
The most reliable integrations combine both. Webhooks give you timely updates; a periodic poll acts as a safety net to catch anything a missed delivery dropped. This reconciliation pass closes gaps without forcing tight polling.
Run the poll infrequently — perhaps hourly or daily — and only reconcile records that look out of sync. That way you get the immediacy of push with the completeness of pull, and a webhook outage degrades to slightly delayed updates rather than lost ones. Treat webhooks as the fast path and polling as the guarantee. Document which is authoritative so consumers know what to trust.
Key takeaways
- Polling pulls on a schedule: simple, but late and often wasteful
- Webhooks push promptly: efficient, but require a reliable public endpoint
- Verify webhook signatures and acknowledge before doing heavy work
- Webhook deliveries can repeat or arrive out of order — handle both
- Combine webhooks with occasional polling to catch missed events
FAQ
Which is better, polling or webhooks?
Neither universally. Webhooks suit frequent, time-sensitive updates and avoid wasted calls; polling suits low-frequency updates or when you cannot expose an endpoint. Many strong designs use both together.
How do I avoid acting on a webhook twice?
Deduplicate using a stable event identifier and an idempotent consumer. Record processed event ids and skip any you have already handled, since providers may redeliver the same event.
What if my webhook endpoint is down?
You may miss deliveries unless the provider retries. A periodic reconciliation poll is the safety net: it catches anything dropped during an outage so missed pushes become delayed updates, not lost ones.
Ready to build?
Read the API reference, grab the OpenAPI spec, and ship a resilient integration.