Try
↑ ↓ move↵ openesc close
In this lesson · topic 7 of 7
  1. 1. A message that must arrive once, in order
  2. 2. Requirements, numbers, API and data model
  3. 3. Break the network and watch delivery
  4. 4. Loss, resends and the order they create
  5. 5. Gateways, connections and crashes
  6. 6. Receipts, offline inboxes and presence
  7. 7. The chat system in review

Topic 7

The chat system in review

3 min read

Predict first

What does a per-conversation sequence number give you?

Predict first

A client holds messages 1, 2 and 4. What should a client that holds for order show?

Predict first

A user comes back online after an hour. How do they catch up?

Take away

  • Chat needs a persistent connection per online user, held by thin gateway servers.
  • Assign a sequence number per conversation on the server. It gives order, duplicate detection and catch-up.
  • Delivery is at-least-once. Acknowledge, resend, and drop copies by number on the client.
  • Holding for order removes misordering and delays the slowest messages.
  • A gateway crash drops its users. They reconnect with backoff and catch up from their inbox.
  • Store before you push. Offline delivery is then the same read as history.
  • Presence is a heartbeat that expires. It can be late. Messages cannot.

Sources

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms