Real-Time APIs & Webhooks
Push events to clients and other systems as they happen, choosing between polling, server-sent events, WebSockets and webhooks and running each reliably.
4 objectives 6 steps about 130 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Choose short polling, long polling, server-sent events, WebSockets or webhooks for a requirement, justifying the choice by direction of data flow, latency, connection cost and proxy and client support.
- Stream incremental results over server-sent events or a chunked response, including relaying an upstream stream such as LLM tokens, with heartbeats, resume via Last-Event-ID and cleanup when the client disconnects.
- Serve WebSocket connections that authenticate and check the origin at the handshake, follow a versioned message protocol, bound each connection's send queue, and fan out events across server processes through a pub/sub channel.
- Deliver outgoing webhooks from a job queue with signed payloads, event IDs for deduplication, retries with backoff and a delivery log, and verify an incoming webhook's signature and timestamp before acting on it.
Lesson plan
6 steps, about 130 min · 5 of 5 lessons available so far
- Polling, Push or Callback? Choosing a Delivery Channel Concept · 20 min
- Streaming Responses and Server-Sent Events Worked example · 25 min
- Lab: An Authenticated WebSocket Feed Across Workers Lab · 30 min
- Webhooks Others Can Trust: Sign, Retry, Verify Worked example · 25 min
- Long-Lived Connections in Production: Proxies, Limits and Deploys Concept · 15 min
- Check: Choose and Defend a Real-Time Design Knowledge check · 8 questions
Practise it
Add live updates to your service: a server-sent events endpoint that streams task-change events and resumes from Last-Event-ID, a WebSocket channel for a team board that authenticates at the handshake and fans out across two worker processes through Redis pub/sub, and signed outgoing webhooks sent from the job queue with retries and a delivery log; tests prove that a reconnecting client misses no events and that a tampered or replayed webhook is rejected.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Chat ServerIntermediate · 8–16 h
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.