Paths Subjects Questions Quizzes Pricing Search
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."

  1. Design a wide-column schema (partition key, clustering key, columns) that serves this query efficiently.
  2. Explain why a naive relational design with a single global messages table and a created_at index performs poorly at hundreds of thousands of writes/s.
  3. 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

← Back to Design a Chat System (WhatsApp / Slack / Messenger) practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.