Advanced
Open
Pro
Designing the Message Storage Schema
You need to support the query "fetch the most recent 50 messages of conversation C, and let a client page further back in time."
- Design a wide-column schema (partition key, clustering key, columns) that serves this query efficiently.
- Explain why a naive relational design with a single global
messagestable and acreated_atindex performs poorly at hundreds of thousands of writes/s. - A very active conversation (a huge public channel) can produce far more messages than a typical DM. How does this affect your partitioning choice, and what is the standard mitigation for a partition that grows too hot or too large?
Share this question