Slack architecture: how Slack scaled (3 case studies)
Slack's datastores moved from active-active MySQL pairs to Vitess over several years, so data could be sharded by any key, not only by workspace (the 2020 post cites 2.3 million QPS). Real-time messaging runs on channel and gateway servers that fan messages out to millions of connected clients over WebSockets, and Flannel, an application-level edge cache, serves user and channel data lazily so huge teams don't need giant boot payloads.
We track 3 public engineering write-ups by Slack, published between 2017 and 2023. They cover consistent hashing, database migration, edge caching and fan-out. Stack mentioned most: WebSockets (2). 1 of the 3 state concrete scale numbers, for example "2.3 million QPS". Each card below links to our short summary and the original post.
Tech used in Slack's scaling write-ups
Slack scaling timeline: every story, summarized
- 2017-05-31
Flannel: An Application-Level Edge Cache to Make Slack Scale
Slack added Flannel, an edge cache that serves user and channel data lazily so huge teams no longer need giant boot payloads.
- 2020-12-01
Scaling Datastores at Slack with Vitess
Slack's multi-year migration from active-active MySQL pairs to Vitess, so data could be sharded by any key, not only workspace.
- 2023-04-11
Real-time Messaging
An overview of Slack's channel and gateway servers that fan messages out to millions of connected clients in real time.
FAQ
What database does Slack use?
MySQL. Slack's 2020 post describes a multi-year migration from active-active MySQL pairs to Vitess, which lets it shard data by any key, at 2.3 million QPS.
How does Slack deliver messages in real time?
Slack's 2023 Real-time Messaging post describes channel servers and gateway servers that use pub/sub and consistent hashing to fan messages out to millions of connected clients over WebSockets.
How does Slack handle very large teams?
Slack's 2017 post introduces Flannel, an edge cache written in Go that serves user and channel data lazily, so clients in huge teams no longer need giant boot payloads.