Real-Time Chat & VoIPPRODUCTION RETROSPECTIVE

Discord: Trillions of Messages on ScyllaDB & Elixir WebSockets

Scaling real-time communications to billions of daily messages: Elixir process multiplexing, migrating from Cassandra to ScyllaDB C++, and WebRTC audio mesh routing.

High-Level Architectural Overview

Discord moved trillions of messages from Apache Cassandra to ScyllaDB. The migration eliminated Java Garbage Collection pauses that previously caused tail latency spikes, reducing P99 read latencies from seconds to under 5ms.

Key Engineering Problems & Trade-Offs

Cassandra to ScyllaDB: C++ & Seastar Framework

Trillions of messages, millions of concurrent voice & chat connections
The Scaling Problem

JVM Garbage Collection (GC) pauses causing severe P99 and P99.9 latency spikes across a 177-node Cassandra cluster storing trillions of messages.

Engineering Solution

Migrated to ScyllaDB, a C++ rewrite of Cassandra utilizing the Seastar thread-per-core asynchronous reactor model with no GC pauses.

Architectural Trade-Offs

Engineered complex zero-downtime dual-write and asynchronous reconciliation pipelines vs 90%+ drop in cluster hardware footprint.

How to Say This in an Interview

Explain how JVM GC pauses can trigger false-positive node failure detections in gossip protocols, leading to cascading cluster instability.

Curriculum Topics Used in Discord Architecture (3)
Full Syllabus
Primary Technical Sources & Published Papers
How Discord Stores Trillions of Messages

Bo Ingram, Discord Engineering • 2023

Ready to Practice Discord-Style Systems?

Start with foundational networking, compute, and storage, and build up to complex distributed consensus.

Start Free: Topic #1