CoursesSystem Design Case Studies

The Chat Service

Messaging for fifty million users: the long-lived connections and the servers that hold them, one order per conversation and delivery that survives a retry, presence and the offline device, and the whole design under a reconnect storm.

Lessons
5
Exercises
29
Minutes
34

Start Fifty Million Open Connections

  1. 1

    Fifty Million Open Connections

    After this lesson you can size a fleet of connection servers, route a message to the server holding the recipient's socket, and survive the moment a server dies with half a million connections on it.

    DebugMultiple choiceShort answerTrace
    5 exercises
    6 min
  2. 2

    One Order per Conversation

    After this lesson you can give each conversation a single order of messages, make a resent message appear once, and let a client resume exactly where it left off.

    DebugFill blankMultiple choiceTrace
    5 exercises
    6 min
  3. 3

    Presence, and the Offline Device

    After this lesson you can implement presence with a bounded cost, decide what reaches an offline device and how, and keep push notifications from becoming a second copy of the chat.

    DebugMultiple choiceShort answer
    5 exercises
    6 min
  4. 4

    Checkpoint: Chat VariationsCheckpoint

    The same design under different numbers: support chat, a broadcast channel, and a chat with no presence.

    DebugMultiple choiceShort answer
    6 exercises
    6 min
  5. 5

    Boss: The Chat ServiceBoss

    The whole design: the question, the fleet, the stores, the send path, the reconnect storm, the duplicated message, the revised paths, and the tradeoff you defend.

    Code orderMultiple choiceShort answerTrace
    8 exercises
    10 min