Comparison
Discord vs Slack: Two Ways to Build Real-Time Chat
By Ankur NayakReviewed
Discord and Slack solve the same core problem, delivering a message to everyone in a channel in real time and storing it forever, and both have written in detail about how. Both hold WebSockets open to clients, both use consistent hashing to give each conversation an owner, and both fan messages out from that owner to connected users.
Their public writing emphasises different halves of the problem. Discord's is storage-first: how to keep trillions of messages readable when one channel suddenly gets thousands of readers. Slack's is routing-first: how a message reaches every subscribed gateway, in every region, in about half a second.
Discord
Full designSlack
Full designSide by side
| Dimension | Discord | Slack |
|---|---|---|
| Unit of ownership | A process per guild (server), found by consistent hashing (2017) | A Channel Server per channel, on a consistent hash ring managed by CHARMs |
| Client connection | WebSocket to a session process (Elixir GenServer); up to 500,000 per Erlang VM | WebSocket via Envoy to Gateway Servers in multiple regions |
| Fan-out | Guild process fans events to every connected member's session; Manifold batches per node | Channel Server sends to every subscribed Gateway Server, which pushes to its clients |
| Message storage | ScyllaDB, partitioned by (channel, time bucket), replication factor 3, quorum reads/writes | MySQL sharded by Vitess, messages sharded by channel ID |
| Hot-spot defence | Rust data services coalesce identical requests, routed by channel ID | Flannel edge cache serves boot data and absorbs reconnect storms |
| Failure story | Quorum survives a replica loss; ScyllaDB removed GC pauses | Replacement Channel Server in under 20 s; regions drained on failure |
| Scale (latest public) | Trillions of messages; 177 Cassandra → 72 ScyllaDB nodes (2022) | 2.3M database queries/s (2020); ~500 ms worldwide delivery (2023) |
Verdict
Both architectures share the same skeleton: persistent connections, an owner per conversation chosen by consistent hashing, and fan-out from that owner. Discord's posts show what to do when reads of history become the bottleneck: coalesce requests and pick a database with predictable tail latency. Slack's show what to do when delivery across regions is the challenge: stateful channel servers, gateways near users and an edge cache. In an interview, design the skeleton first, then ask which of those two bottlenecks your requirements make worse.
Frequently asked questions
Do Discord and Slack use the same architecture?
Broadly similar: both keep WebSocket connections open, assign each conversation an owner with consistent hashing and fan messages out to connected clients. They differ in detail: Discord models each server as a process and stores messages in ScyllaDB, while Slack uses Channel Servers and Gateway Servers and stores data in MySQL with Vitess.
Which databases do Discord and Slack use for messages?
Discord moved its messages from Cassandra to ScyllaDB in 2022, partitioned by channel and time bucket. Slack uses MySQL sharded with Vitess, with message data sharded by channel ID; by 2020 Vitess served 99% of its query load.
More comparisons
- Netflix vs Uber: Streaming Bytes vs Real-time State
- News Feed vs Notification Service: Two Kinds of Fan-out
- Spanner vs DynamoDB: Global SQL or Predictable Key-Value
- Stripe vs Adyen: Two Ways to Never Lose a Payment
- WhatsApp vs Slack/Discord-style Chat: Architecture Compared
- YouTube vs Twitch: On-Demand Video vs Live Streaming