Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Episode 7 of 9 · Slack

One column, three jobs: what breaks when each job needs its own owner

Chapters

Narration

Picture the card you carry at a big office. It opens the front door. It tells the canteen who you are. And it decides which floor your lift will stop at. One card, three jobs, and it works fine, until two companies have to share one building. That is exactly what happened to Slack. Its database had one column doing three different jobs. The column is called team I D. It worked for four years. Then three new features, each sold by the sales team, pulled the three jobs apart. So here is the question. What happens when one column has three jobs, and each job needs a different owner? Why should you care? Because every system picks a key early, when the product is small and one idea fits everything. The key feels like a detail. Then the roadmap arrives, and the key turns out to hold up the whole building. Slack took years to change theirs, even with good tools. So the question for the next few minutes is this. What happens when one column has three jobs? Here is the plan. First, the old way, one label, three jobs. Second, Enterprise Grid, which pulls out the identity. Third, Slack Connect, which pulls out the shelf. And fourth, the key and the law, which pull out the boundary. Stop one, the old way. Picture a company as a warehouse. Each company gets its own aisle, and the label on that aisle is team I D. That one label answers three questions. First, where do the rows live? Rows are the saved records, every user, channel and message. The label points to the machine that holds them. The name for that is the shard key. Second, may you see this? Anything under your company's label is yours, and nothing else is. That is the auth boundary. Third, who even are you? A user number only had to be unique inside one company. That is the identity space. Your session was a user and a workspace, so every question already knew where to go. Privacy even lived in the id. A C at the front meant public. A G meant private. One label, three jobs, and a good design for four years. Stop two, Enterprise Grid. A company with three hundred thousand employees will not share one general channel. So a company becomes an organisation, made of many workspaces, with a shard of its own above them. Now a read has two places to look. First the workspace shard. If the row is not there, then the org shard. Count it. Best case, one lookup. Worst case, one plus one, two lookups. And permissions get checked at both levels. Every read can now cost double. That is the price of the second layer. The second change is about who you are. Inside one workspace, your user number only had to be unique there. Across an organisation, it has to be unique everywhere. So every person is issued a second identity, org wide and brand new. Their old number, U zero one, stays. The new one, W zero one, sits beside it. Two names for one person. Moving everyone to the new one meant rewriting every team I D, even ones buried inside blobs of JSON. That is the first job pulled out of the column. Identity. Stop three, Slack Connect. You and your vendor, two companies, one shared channel. Which shard does it live on? The obvious answer is to copy it into both companies. Look at the cost. The board counts a billion messages a week. Two copies is two billion. That is double the storage. Worse, two copies means two orderings of one conversation. Your copy might put a reply first, and theirs might put it second. Two truths is not a design. It is a bug you scheduled. So the channel gets one home, on one shard, and both companies read from it. Each company still wants its own name for the channel, and its own settings. So a small bridge table holds one row per side, with that side's name and overrides. One copy of every message, plus one row per company. That pulled out the second job, the shelf, because the channel is now the unit, not the company. And it killed the id prefix. Two companies can want different privacy rules for one channel, so privacy cannot sit in a C or a G any more. It became an ordinary yes or no column you can change. That is why four separate APIs were retired and replaced by one. Stop four, the key and the law. A customer can hold their own encryption key. Slack asks for a short lived data key, and keeps it only in memory, for five minutes. If the customer cuts access, it ends. Now the collision. A shared channel has one physical home, but two policy owners. Whose key encrypts it? Whose retention rules apply? And if one side is in Germany and the other in Chicago, whose country? Data residency is selective, and only possible at all because the key is now the channel. That is the third job, the boundary, pulled out. Three things to keep. One. A key that does three jobs is three promises made at once, and each new feature can break one of them. Two. Every fix had a bill. Grid cost a second lookup on a miss, and Connect cost a bridge table and a rewrite of the ids. Three. Ask what your roadmap will do to your keys, before you pick them. Three features on three sales slides, and each one pulled a different job out of the same column. Pick your keys against the roadmap, not the whiteboard.

Based on the board One Channel, Two Owners.

Covered in Slack, the case study.

Saved in this browser, and to your account when you sign in.