sys0Early access
Back to your course

Part 1 · Foundations

  1. Overview4 lessons · 57 min
  2. 1Polling, SSE, WebSockets, pushRead
  3. 2Live updates across many serversRead
  4. 3Proof: 10,000 order screensRead
  5. 4Lab: Add live updates to the clinicLab

Part 2 · Distributed systems

Part 3 · Under the hood

sys0Early access

Module 6 / Live updates / Overview

Module 6 4 lessons 57 min

Live updates

A new order has to appear on the restaurant's tablet the moment it's paid, and the customer wants to see it being cooked. Both apps ask every 2 seconds, and at the dinner rush most of our traffic is “any news?”

In this module

3 Read · 1 Lab

  1. 6.1Polling, SSE, WebSockets, pushAsk every few seconds, or keep a connection open. Four ways to get news to the restaurant and the customer, what each costs the server, and why polling is often enough.Read12 min
  2. 6.2Live updates across many serversThe restaurant's tablet is connected to server 1, but the new order lands on server 2. Redis pub/sub joins them. And when the tablet's Wi-Fi drops, it fetches what it missed from the database - the push is fast, the database is the truth.Read12 min
  3. 6.3Proof: 10,000 order screensLoad-test 10,000 open order screens asking every 5 seconds, then holding one connection each. Then send a new order through two servers, and cut a tablet's connection mid-rush.Read8 min
  4. 6.4Lab: Add live updates to the clinicTell patients in the waiting room the moment Dr. Rao is running late - from any server, without them refreshing.Lab25 min
Start with 6.1 · Polling, SSE, WebSockets, push
Then · Module 7Background jobs