- When should I choose Cassandra over PostgreSQL?
- Cassandra excels at write-heavy workloads at scale (IoT, time series, event logs) where data is accessed by known partition keys. PostgreSQL is better for complex queries, joins, and ACID transactions. Do not use Cassandra if you need ad-hoc queries without known access patterns.
- What is a partition key and why does it matter?
- The partition key determines which node stores the data. A poor partition key creates 'hot spots' (one node overwhelmed while others are idle). Good partition keys distribute data evenly — often using user IDs, event IDs, or time buckets.
- Does CQL support JOINs?
- No — Cassandra does not support joins or subqueries. Data must be denormalized at write time, duplicating it across multiple tables optimized for different query patterns. This is by design for horizontal scalability.