Communicationchapter 4 of 4 · 3 lessons
Webhooks vs Polling
Webhooks push events to you; polling has you repeatedly ask for updates.
When another system has news for you there are two ways to hear it. Keep asking, or hand over an address and let them call you.
The second feels obviously better than asking every ten seconds, right until you are the one responsible for not losing the calls. Losing one is quiet. Nothing appears in your logs, because from your side nothing happened at all, and the first person to notice is a customer asking where their order went.
Lessons
3 in this chapter- How Webhooks WorkYou register a URL, the provider POSTs events to it, and suddenly you run a public endpoint with obligations.2 min
- Making Webhooks ReliableAssume deliveries will fail, duplicate, and go missing, then build so none of that loses an event.3 min
- When Polling Is Actually RightSometimes the boring loop that asks every minute is the more reliable and cheaper design.3 min