SpinTheMic
Pro

Interview practice question

Modelling chat messages in Cassandra

Backend Engineering · NoSQL and Redis · Beginner

How would you design a Cassandra table to store chat messages for fast retrieval of recent messages?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Partition key: conversation_id (+ time bucket).
  • Clustering: message_time/id DESC.
  • Query latest N per conversation.
  • Bucket to bound partition size.
  • TTL if messages expire.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics