How would you model time-series data effectively in Cassandra?
Last updated
Partition by entity plus a time bucket, e.g.
(sensor_id, day), so no partition grows unbounded.Cluster by timestamp with
CLUSTERING ORDER BY (ts DESC)so newest readings come first and time ranges are contiguous reads.Write append-only (one row per reading) and use
TTLfor expiry instead of deletes, which create tombstones (deletion markers).
- https://medium.com/@shubham.patel191295/cassandra-for-system-design-interviews-when-to-pick-it-how-it-shards-and-every-question-youll-5542335def0e
- https://docs.datastax.com/en/cql/hcd/data-modeling/best-practices.html
- https://cassandra.apache.org/doc/latest/cassandra/developing/data-modeling/data-modeling_logical.html
- https://cassandra.apache.org/doc/latest/cassandra/managing/operating/compaction/twcs.html
- https://cassandra.apache.org/doc/stable/cassandra/developing/cql/ddl.html
- https://reintech.io/blog/implementing-time-series-data-cassandra
- https://oneuptime.com/blog/post/2026-01-27-cassandra-time-series/view
- https://medium.com/netflix-techblog/dynamically-splitting-wide-partitions-in-cassandra-for-time-series-workloads-0eded064f456