Free course · 20 lessons · Intermediate

Real-Time APIs

WebSockets, SSE, long polling and WebTransport; designing, receiving and securing webhooks; fan-out, presence, connection management, slow clients, real-time auth, resync, mobile and testing.

Start the course

1. Real-Time Transports

WebSockets, SSE, long polling and what comes next.

  1. The Real-Time Landscape — Choosing between polling, long polling, SSE, WebSockets, webhooks and push.
  2. WebSockets in Depth — Handshake, frames, heartbeats, close codes and message protocols.
  3. Server-Sent Events — Simple, HTTP-native server push with automatic reconnection.
  4. Long Polling and Fallbacks — When persistent connections aren't available.
  5. Emerging Options: HTTP/3, WebTransport and Managed Services — What's new and when to use a managed real-time platform.

2. Webhooks

Designing, receiving, securing and making webhooks reliable.

  1. Designing Webhook Delivery (Sender Side) — Event types, payloads, subscriptions and delivery pipeline.
  2. Receiving Webhooks Reliably — Verify, persist, acknowledge fast and process asynchronously.
  3. Webhook Security — Signatures, secrets rotation, SSRF protection and payload safety.
  4. Webhook Reliability: Retries, Ordering and Replay — Make missed deliveries recoverable.

3. Scaling Real-Time Systems

Fan-out, presence, connection management, slow clients and auth.

  1. Fan-Out with Pub/Sub Backends — Deliver messages to users connected to many server instances.
  2. Presence, Typing Indicators and Ephemeral State — Track who's online without overwhelming the system.
  3. Managing Connections at Scale — Load balancing, limits, deploys and reconnect storms.
  4. Slow Clients and Backpressure — Protect servers from consumers that can't keep up.
  5. Authentication and Authorization for Real-Time — Auth at connect, per-channel authorization and token expiry.

4. Real-Time in Practice

Ordering and resync, mobile, testing and choosing managed services.

  1. Ordering, Gaps and Resynchronization — Detect missed messages and recover state.
  2. Real-Time on Mobile — Sockets in the foreground, push in the background, battery awareness.
  3. Testing Real-Time Systems — Unit, integration, load and chaos tests for persistent connections.
  4. Managed vs Self-Hosted Real-Time — Make a build-or-buy decision with real numbers.

5. Capstone

Design a live collaboration feature and a webhook platform.

  1. Capstone: Real-Time Order Tracking — Design live updates for customers, drivers and support agents.
  2. Capstone: Build a Webhook Platform — Design outbound webhooks for a SaaS with 20,000 customer endpoints.