Re:How Discord stores trillions of messages
by justnoise on Saturday September 28, 2024 @09:38PM
(#41684162)
I'd guess that Discord's storage systems lean towards processing a lot more writes than reads. Postgres and other databases that use B-tree indexing are ideally suited for read heavy workloads. LSM based databases like Cassandra/Scylla are designed for write intensive workloads and have very good horizontal scaling properties built into the system.
[ Parent
| on HN ]
Re:How Discord stores trillions of messages
by Aeolun on Saturday September 28, 2024 @11:45PM
(#41684748)
Would you actually have more writes than reads? Are messages read by fewer people than post them?
Re:How Discord stores trillions of messages
by sadeshmukh on Sunday September 29, 2024 @12:06AM
(#41684820)
When you send a message, afaik it sends to all people looking at it at the time. So there is no read when in a conversation, and maybe the reads are batched when reading multiple.
Re:How Discord stores trillions of messages
by jhgg on Sunday September 29, 2024 @02:55AM
(#41685410)
Read traffic is much higher than write traffic due to mobile clients needing to sync chat history more often as their sessions are much shorter lived. Also search queries execute 1 query per result. And don't forget people doing GDPR data dump requests. It adds up.