Partition keys, clustering keys, consistency levels, tunable consistency, single-table design and eventual consistency.
35 cards · basic cards · AI-written, checked twice. Edit anything.
- What is a partition key in Cassandra or DynamoDB?
Show answer
The primary key component that determines which node stores the data through hash-based distribution.
- How does Cassandra distribute data using partition keys?
Show answer
The partition key is hashed to determine which nodes own the partition.
- Can you have a composite partition key in Cassandra?
Show answer
Yes, multiple columns can be combined to form a single partition key.
- What happens if a partition key hash leads to uneven data distribution?
Show answer
Some nodes become hot spots and receive more data than others, causing performance imbalance.
- What is a clustering key in Cassandra?
Show answer
A column that determines the sort order of rows within a partition.
- How do clustering keys differ from partition keys?
Show answer
Partition keys determine which node stores data, clustering keys determine sort order within a partition.
- Can you perform range queries on clustering keys in Cassandra?
Show answer
Yes, range queries (greater than, less than, between) on clustering keys are efficient.
- In what order are rows sorted within a partition in Cassandra?
Show answer
By the clustering key columns, in the order they are defined.
- How is a row uniquely identified in Cassandra?
Show answer
By the combination of partition key and clustering key together.
- Why would you choose a timestamp as a clustering key?
Show answer
To keep time-series events ordered within a partition, allowing efficient range queries by time.
- What is a consistency level in Cassandra?
Show answer
A setting that specifies how many replicas must respond before a read or write is acknowledged.
- What does the ONE consistency level mean in Cassandra?
Show answer
Only one replica must respond for the operation to be acknowledged.
- What does the QUORUM consistency level mean in Cassandra?
Show answer
A majority (more than half) of replicas must respond for the operation to be acknowledged.
- What does the ALL consistency level mean in Cassandra?
Show answer
All replicas must respond for the operation to be acknowledged.
- How does stricter consistency affect performance in Cassandra?
Show answer
Stricter consistency (more replicas required) increases latency but reduces staleness.