Discord architecture: how Discord scaled (6 case studies)

Discord's architecture, as told in its own engineering posts: messages moved from MongoDB to Cassandra (2017) and later from Cassandra to ScyllaDB, with Rust data services in front that coalesce requests for hot partitions (2023, trillions of messages). Message search runs on many small Elasticsearch clusters sharded by guild. Real-time fan-out runs on Elixir, scaled to 5,000,000 concurrent users, and the Read States service was rewritten from Go to Rust.

We track 6 public engineering write-ups by Discord, published between 2017 and 2026. Techniques that come up more than once: database migration (2). Stack mentioned most: Rust (3), Cassandra (2) and ScyllaDB (2). 5 of the 6 state concrete scale numbers, for example "dozens of clusters, hundreds of database nodes". Each card below links to our short summary and the original post.

Tech used in Discord's scaling write-ups

Discord scaling timeline: every story, summarized

  1. 2017-01-13

    How Discord Stores Billions of Messages

    Early story of Discord outgrowing MongoDB and moving messages to Cassandra with a channel+time-bucket partition key.

    billions of messages120 million messages/daydatabase migrationdata modelingpartitioningCassandraMongoDB

    Read the original post →

  2. 2017-03-16

    How Discord Indexes Billions of Messages

    Discord built message search on many small Elasticsearch clusters, sharding by guild and indexing lazily through a queue.

    billions of messagesshardingqueuessearch indexingElasticsearchPython

    Read the original post →

  3. 2017-07-06

    How Discord Scaled Elixir to 5,000,000 Concurrent Users

    Discord tuned its Elixir guild processes and fan-out paths, building custom libraries to push events to millions of concurrent users.

    5,000,000 concurrent usersfan-outconcurrencyload sheddingElixirErlang/BEAM

    Read the original post →

  4. 2020-02-04

    Why Discord is switching from Go to Rust

    Discord rewrote its Read States service from Go to Rust to get rid of garbage-collection latency spikes in a large in-memory cache.

    rewritecachinglatency reductionRustGo

    Read the original post →

  5. 2023-03-06

    How Discord Stores Trillions of Messages

    Discord moved its message store from Cassandra to ScyllaDB and put Rust data services in front of it to coalesce hot-partition requests.

    trillions of messagesdatabase migrationrequest coalescingdata services layerScyllaDBCassandraRust

    Read the original post →

  6. 2026-05-08

    How Discord Automates ScyllaDB Clusters at Scale

    Discord's 7-person persistence team replaced fragile Python and bash scripts with the Scylla Control Plane, a Rust framework of idempotent tasks with declared preconditions, composed into YAML workflows. Jobs batch nodes by availability zone with concurrency limits to protect quorum, store their state in SQLite so they resume after interruptions, and send a webhook alert on unrecoverable errors. Operations like standing up shadow clusters and rolling upgrades went from a day and a half of babysitting to under two hours.

    dozens of clusters, hundreds of database nodes7-person persistence teamdatabase operations automationidempotent taskszone-aware rolloutsresumable jobsScyllaDBRustYAMLSQLite

    Read the original post →

FAQ

What database does Discord use?

In the posts we track, Discord stored messages in MongoDB first, moved them to Cassandra with a channel plus time-bucket partition key (2017), then moved the message store from Cassandra to ScyllaDB (2023). Message search uses Elasticsearch.

Why did Discord switch from Go to Rust?

Discord rewrote its Read States service from Go to Rust to get rid of garbage-collection latency spikes in a large in-memory cache (2020 post).

How does Discord handle millions of concurrent users?

Discord's 2017 post describes tuning its Elixir guild processes and fan-out paths, and building custom libraries, to push events to 5,000,000 concurrent users.

The best scaling write-ups, weekly

One email a week. No spam.

Subscribe

Browse all 87 topics →