@ProgressiveCod2: 9 points on how Discord stored...
@ProgressiveCod2
39 views
Dec 25, 2023
1
9 points on how Discord stored trillions of messages:
[1] In 2017, Discord migrated from MongoDB to Cassandra.
[2] Over the next few years, its DB cluster grew from 12 to 177 Cassandra nodes.
[3] The Cassandra cluster ran into serious performance issues. Few reasons for this:
👉 The Partitioning Strategy
👉 Reads more expensive than writes with Cassandra
👉 Cassandra's compaction process and garbage collection.
[4] Ultimately Discord initiated a massive project to transform the architecture.
[5] They migrated the storage from Cassandra to ScyllaDB. A few reasons were better workload isolation, no garbage collection, and special support by the ScyllaDB team.
[6] To augment the solution, Discord also built dedicated data services in Rust.
[7] These data services implemented a technique called Request Coalescing to make data fetching more efficient.
[8] A special migration program was written in Rust. This enabled migration at a speed of 3.2 million per second.
[9] The first real test of the new database came during the FIFA World Cup final. And it passed with flying colors.
However, these points barely scratch the surface of the project's complexity.
There's a lot more to unpack👇
[1] In 2017, Discord migrated from MongoDB to Cassandra.
[2] Over the next few years, its DB cluster grew from 12 to 177 Cassandra nodes.
[3] The Cassandra cluster ran into serious performance issues. Few reasons for this:
👉 The Partitioning Strategy
👉 Reads more expensive than writes with Cassandra
👉 Cassandra's compaction process and garbage collection.
[4] Ultimately Discord initiated a massive project to transform the architecture.
[5] They migrated the storage from Cassandra to ScyllaDB. A few reasons were better workload isolation, no garbage collection, and special support by the ScyllaDB team.
[6] To augment the solution, Discord also built dedicated data services in Rust.
[7] These data services implemented a technique called Request Coalescing to make data fetching more efficient.
[8] A special migration program was written in Rust. This enabled migration at a speed of 3.2 million per second.
[9] The first real test of the new database came during the FIFA World Cup final. And it passed with flying colors.
However, these points barely scratch the surface of the project's complexity.
There's a lot more to unpack👇
2
I talk in detail about how Discord stores trillions of messages in my article.
Here's the link:
https://t.co/2bRVQQp240
Here's the link:
https://t.co/2bRVQQp240
