The Boot Payload Problem: Why Connecting Was the Bottleneck

The Original Contract: rtm.start

When a Slack client connected, it called rtm.start, and the server replied with everything the client might need to render the UI without further round trips:

  • Every user in the workspace — ID, name, real name, avatar URLs, title, timezone, status, deleted flag
  • Every channel — public channels, the user's private channels, DMs, group DMs, with topics and purposes
  • Membership lists for those channels
  • The latest messages in those channels — not just metadata, but a slice of content too
  • Bots, integrations, custom emoji, workspace preferences
  • …and finally, the WebSocket URL to connect to

That is Slack's own list — “users, channels, members in those channels, the latest messages, DMs, group DMs, etc.” — with the field-level detail filled in from the public API reference for rtm.start.

For a 20-person startup this is a delightful design. One request, and the client has a complete local model of the world; every subsequent interaction is instant because nothing needs fetching. Rendering a message just needs a local lookup of the author's profile.

What “Usable” Actually Means

Before pricing that payload, it is worth asking what it is for. “Boot” sounds like a single event. It is really a ladder, and the rungs have wildly different data dependencies — which matters, because only the middle ones are on the critical path. The user cannot tell whether the rest arrived at connect or three seconds later.

RungWhat the user seesWhat that actually requiresCritical path?
1. ShellWindow, sidebar chrome, a spinnerNothing from the serverYes — and free
2. SidebarYour channels, in order, with correct unread badgesYour membership rows — one per channel you are inYes
3. Current channelThe last ~50 messages, with author names and avatars~50 message rows, plus the ~15 distinct humans who wrote themYes
4. AttachedNothing visible — an open socket, and proof that nothing was missed while it was shutA cursor per stream, and a backfill from itYes — the only rung that is a correctness requirement rather than a UX one
5. AmbientPresence dots, typing, unfurled links, custom emojiThe presence part’s presence subscription, the async work part’s job queueNo — arrives late, nobody notices
6. LatentSearch, @-mention autocomplete over 30,000 people, history older than the screenServer-side queries — which used to be local array scansNo — but see the cost at the end of the Flannel part

Read rtm.start against that ladder and its first defect is not volume, it is ordering: rung 6's data is fetched synchronously, at connect, before rung 2 can paint. The cheapest rungs are blocked behind the most expensive one. A design that fetched exactly the same bytes but let the sidebar render after the first few kilobytes would have felt like a different product at the same cost.

And the preloading is not carelessness — it falls out of a real dependency. A message row does not carry its author's name; it carries U777. A membership row does not carry a channel's name; it carries C456. Rendering anything is therefore ID resolution, and the moment you decide resolution must be a local lookup — which is exactly what makes the old client feel instant — you have committed to preloading the transitive closure of every ID that could appear on screen. In a chat workspace, that closure is near enough the whole workspace.

So preloading is not a decision about payload size. It is a consequence of where ID → object resolution happens. Keep resolution local and you are obliged to ship the closure; move it to a remote, batched, cached call and the closure collapses to what is on screen. Every mechanism in the Flannel part is downstream of that one relocation.

The Cost Function

Now write down what that payload costs:

payload(workspace) ≈ (users × ~1 KB) + (channels × ~0.5 KB) + memberships + recent messages

The per-object sizes are the guide's rough estimates — Slack publishes the ratios below, not the bytes. The shape is what matters: the payload is O(size of workspace), and critically it is not O(what this user actually needs). A user who only ever talks in three channels still downloads all 8,000 channels and all 30,000 colleagues.

And bytes on the wire are only the visible half. Somebody has to produce that snapshot: query every user row, every channel row, every membership row, and serialise the lot — once per connect. Slack does not describe where that ran, but by the Gateway and Channel Servers part’s split it can only be the Webapp reading MySQL, which means the cost is O(workspace) database reads and CPU on the server side too. Hold that thought for the storm below, and for the workspace sharding part: a workspace's data lives on one shard, so a burst of connects from one workspace is a burst of O(workspace) reads against one database.

Slack's published figures make the shape concrete, provided you read them for what they are. They are not payload sizes; they are how many times smaller the bootstrap payload became after Flannel (see Flannel) replaced the snapshot with a working set:

7× smaller after Flannel1,500 users
44× smaller after Flannel32,000 users
Reduction = before ÷ after. Same kind of user, same working set to render — the only variable is how many colleagues they have.

Now do the inference. If the “after” payload is roughly a working set — a similar size for both teams — then the “before” payload was about six times larger for the team that was twenty-one times larger. Sub-linear, so the snapshot had a fat fixed part, but unmistakably growing with the workspace, not with the user. The fact that the savings multiplier itself grows with team size is the proof: a constant-factor problem would have given the same multiplier at every size.

Four Separate Failures, Not One

Slack names four consequences in as many phrases — connection time “starts to take too long,” the client memory footprint “becomes large,” reconnecting “becomes expensive,” and reconnection storms “are resource intensive.” They deserve separating, because each one has a different victim and only the last one is dangerous:

  1. Connect latency. The user opens Slack and stares at a loading state while megabytes transfer and parse. On a phone on cellular, this is the difference between "instant" and "broken."

  2. Client memory. The whole snapshot is held in the client's heap. On a 32,000-user workspace that is a large object graph living in a desktop app the user already accuses of eating RAM — and on mobile it is a background-kill risk.

  3. Every reconnect pays the whole price again. A snapshot is only valid at the instant it is taken, so the client cannot reuse yesterday's: each lid-open, each wifi blip, each tab restore re-downloads and re-parses the entire workspace. Worse, the design's own logic pushes toward making the snapshot bigger — the more you preload (recent history for more channels, say), the fewer stalls on channel switch — so the fix for one symptom feeds failures #1 and #2. The two pressures pull in opposite directions, and there is no setting that satisfies both.

  4. Reconnection storms — the dangerous one. Reconnects are not independent events. A GS deploy, a network blip at a large customer's office, or a laptop-lid-open across a timezone all cause many clients to reconnect at the same instant, and each one demands a full O(workspace) payload.

A causal diagram of the reconnection storm. A Gateway Server restarts, for a routine deploy or because a customer office loses wifi for ten seconds, and all its sockets die at once. Every client it was holding reconnects in the same instant, and each one demands a full snapshot, so the Webapp rebuilds every user, channel and membership row: O(N) bytes out and O(N) reads in per client, all landing on the single MySQL shard that holds that workspace. A side panel shows the arithmetic: N clients times O(N) bytes each equals O(N squared) of work in one burst, drawn as two bars where doubling the workspace turns one unit of work into four. Capacity is linear and the storm is quadratic, so more backend does not help; only a smaller cost function does, which is section 3, and a backoff only changes when you pay. The saturation then feeds a loop: the backend slows, responses miss the client timeout, clients give up and retry, and a dashed arrow carries them back into the same herd, which now grows faster than it drains. Footnotes distinguish the diffuse deploy case, spread over many shards, from the concentrated case of one big office losing wifi, where the herd is the workspace and all of it lands on that workspace's one shard.
Why a routine deploy became the scariest operation

The Reframe That Unlocks the Fix

The naive reading is "the payload is too big, compress it." The next reading is "the snapshot is the same for everyone in the workspace, so cache it once per workspace." That one is closer, and it fails for two instructive reasons. It is not the same for everyone — your private channels, your DMs, your preferences differ from your neighbour's — so the cacheable part has to be separated from the personal part. And it goes stale constantly: one avatar change anywhere in a 32,000-person workspace invalidates the whole cached blob, which is another way of saying the blob is the wrong unit. Cache objects, not snapshots, and invalidate each object from the event that changed it — which is the Flannel part in one sentence. The correct reading is sharper still:

The client was being given the whole workspace when it needed the few hundred objects currently on screen. The bug is not the size — it is that the payload is keyed on the workspace instead of on the user's working set.

Which immediately suggests the fix: send almost nothing at connect, and let the client ask for objects as it needs them. That trade replaces one huge request with many tiny ones — which is only viable if those tiny ones are very fast. Making them very fast, from anywhere on Earth, is the Flannel part.

  • Guarantees: A client that completes rtm.start can render any user or channel in the workspace with zero further round trips — genuinely excellent UX, for as long as the workspace is small.
  • Does not guarantee: That connect cost stays bounded as the customer grows. Cost per connect scales with workspace size, and cost per reconnect event scales with its square — so the largest, most valuable customers are precisely the ones the design punishes hardest.