The Backend Engineering Show with Hussein Nasser cover image

How Discord Stores Trillions of Messages - A deep dive

The Backend Engineering Show with Hussein Nasser

00:00

CQL Statements - How to Cluster Messages in a Database

Cassandra's message table includes the channel ID which is a unique identifier for the channel and the server. Bucket a bucket is literally an integer that represents a Time window very critical to let you know that this message Lived in this time window Because you can have a lot of messages in the same time now and you want them next to each other usually right Especially if they are a bit on to the same channel Why if you do a read? To read certain message at certain time most probably you want to read those messages that are came After and before it right unless it's like direct messages. That should be in a different system Right, but if it's a public channel and that's just

Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner