How Discord Stores Billions of Messages (Inspired by ByteByteGo)
Sysiq Engineering
July 14, 2026
12 min read
How Discord Stores Billions of Messages
Discord handles an unfathomable amount of chat data. This post breaks down their architectural evolution, largely inspired by case studies from ByteByteGo and Reddit engineering communities.
The Early Days: MongoDB
In 2015, Discord started with MongoDB. It was fast to iterate with, but as they hit millions of messages a day, index sizes exceeded RAM. MongoDB's B-Tree indexing meant that random reads on historical messages required costly disk I/O, causing massive latency spikes.The Migration to Cassandra (2017)
To solve the scaling issue, they moved to Apache Cassandra. Cassandra uses an LSM-Tree (Log-Structured Merge Tree) and is optimized for heavy write workloads.This schema was brilliant. Because users read messages sequentially in a channel, Cassandra could fetch a contiguous block of messages straight from disk.
#