LESSON 07 · Shared conversations

Fan out to a small group

Write one group message, then deliver it to eligible members and devices.

SYSTEM VIEW

The message path

Diagram view
Stored copies—
Fanout work—

Watch one group message get stored once and fanned out to 249 inboxes, then see why a 100,000-member channel needs another plan.

  1. Ana posts to a group of 250. The Chat service checks that she is a current member, gives the message the group’s next sequence and stores it once in Message history: message 1077, the single authoritative record.

    Group
    250 members
    Message
    1077
    Order
    group sequence

    What changed

    • Message 1077 posted
    • Ana’s membership checked
    • 1 canonical copy stored
  2. A fanout job puts a reference to 1077 in each recipient’s inbox: Ben’s and 248 more, 249 in all. These are delivery entries, not copies of the message, and each member reads one simple list.

    What changed

    • Group fanout
    • 249 refs: Ben + 248 more
    • Still 1 stored copy
  3. A retried job runs the fanout for 1077 again. Each inbox entry has a unique key, message plus member, so Ben’s inbox skips the repeat. He still has one ref, and Message history still holds one copy.

    Unique key
    message + member

    What changed

    • Fanout for 1077 repeated
    • Ben’s inbox skips it
    • Still 249 refs, 1 copy
  4. Now take a 100,000-member channel posting 10 messages a minute. Writing an inbox entry for every member needs about 16,700 writes a second, and nearly all of them are for people who are not looking.

    Members
    100,000
    Posts
    10 a minute
    Inbox writes
    about 16,700/s

    What changed

    • Group inboxes
    • 100,000 channel members
    • 16,700 inbox writes/s
  5. If 2% of the members are active, pushing only to them needs about 330 a second. The rest pull from the channel when they open it. Discord, for example, stores messages per channel rather than per user.

    Active
    2%
    Pushes
    about 330/s
    Everyone else
    pulls on open

    What changed

    • Push to the 2% active
    • 330 pushes/s
    • The rest pull on open
  6. Pull has its own cost: each open reads the channel and works out the member’s unread count. Switch to writing every inbox: opens stay simple, but writes return to 16,700 a second. The threshold depends on active readership, group size and latency goals.

    Pull
    a read per open
    Every inbox
    16,700 writes/s
    Threshold
    readers, size, latency

    What changed

    • Pull: a read per open
    • Unread count per member
    • Every inbox: 16,700 writes/s
    Delivery

Space plays · ← → step · Home resets

THE IDEA

How it works

Authorize the sender against the group’s current membership, assign a sequence in that group, and persist one canonical message, the single authoritative record. Fanout on write then does the delivery work at send time: a job puts references in recipients’ inboxes, which are per-person lists of what to read, or pushes live events to their devices. For groups capped near 250 members, this write-side work may make each person’s inbox simple to read.

Do not confuse copies in delivery queues with copies of the canonical record. Decide what someone joining later may see, what happens when a member leaves, and whether a retry may repeat a fanout task. Idempotent fanout and membership checks keep those cases predictable: a unique key on message and member means a repeated job cannot add a second inbox entry.

For a very large channel, copying a message to every follower is costly. Take a 100,000-member channel posting 10 messages a minute: fanout on write needs about 16,700 inbox writes per second, nearly all for people who are not looking. If 2% are active, pushing only to them needs about 330 per second, and the rest pull from the channel when they open it. Discord, for example, stores messages per channel rather than per user.

The threshold depends on active readership, group size, and latency goals; “always fan out on write” is not a universal rule. Pull has its own cost: every open becomes a read that must also work out unread counts for that member.

DECISION POINT

A product lifts the group cap from 250 to 100,000. What part of the design deserves immediate review?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Small-group fanout buys simple inbox reads at a bounded write cost.
  • Large audiences may need pull or hybrid delivery, with explicit membership semantics.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
RecallQUESTION 01

Why can per-member inbox fanout be practical for a group capped at 250?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 3 checkpoints answered correctly to complete this lesson.