Briefing

Discord’s Stack Evolution: From Elixir to Rust and ScyllaDB

competitors
by Pavan Sai ·

Review Discord’s stack evolution to understand when to switch languages and databases based on metrics.

What to do now

Analyze your own stack for similar threshold triggers before making language or database changes.

Summary

Discord’s engineering journey illustrates how the company switched languages and databases when specific performance thresholds were breached.

In 2013 the stack comprised Elixir for real‑time messaging, Python for APIs, Go for microservices, MongoDB for storage, and Electron for the desktop client.

By 2017 MongoDB could not scale to 5 million users, prompting a move to Cassandra with 12 nodes; by 2022 the 12‑node cluster had ballooned to 177 nodes, driving maintenance costs up and leading to a migration to ScyllaDB.

In 2019 Elixir’s sorting of large data sets took 170 ms per operation, which was unacceptable at Discord’s scale; rewriting the logic in Rust reduced the latency to 1 ms.

In 2020 Go’s garbage collector, running every 2 minutes, caused latency spikes when scanning millions of cached users; moving the Read States service to Rust eliminated the GC scan and dropped latency from milliseconds to microseconds.

The pandemic pushed monthly active users to 100 million, making the Rust rewrite critical for handling the load.

Discord kept Elixir for messaging, Python for APIs, Electron for the desktop, and React Native for mobile, demonstrating that not everything needs to change—only what fails to meet metrics.

The lesson is to use what works and switch only when data tells you to, avoiding hype‑driven migrations.

Key changes

  • Elixir for real‑time messaging, Python for APIs, Go for microservices, MongoDB to Cassandra 12 nodes, Cassandra to ScyllaDB 177 nodes
  • Elixir sorting 170 ms → Rust 1 ms
  • Go GC latency spikes fixed by Rust rewrite
  • 100 million monthly users after pandemic
  • Discord kept Elixir, Python, Electron, React Native
  • Switches triggered by measurable performance thresholds
  • Not all components need to change
  • Use what works until metrics dictate change

Affects

none

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting