CASSANDRA Skills 3 — Questions and Answers
Question 1: What does a Cassandra consistency level of QUORUM mean for a cluster with a replication factor of 3?
- All 3 replicas must acknowledge
- At least 2 replicas must acknowledge (Correct answer)
- Only 1 replica must acknowledge
- The nearest replica must acknowledge
Correct answer: At least 2 replicas must acknowledge
QUORUM requires a majority, calculated as floor(RF/2) + 1, so for RF=3 that means 2 acknowledgments.
Question 2: Which tool can you use to profile slow CQL queries in a Cassandra 4.x cluster?
- nodetool cfstats
- TRACING ON in cqlsh (Correct answer)
- nodetool tpstats
- cassandra-stress --profile
Correct answer: TRACING ON in cqlsh
Enabling `TRACING ON` in cqlsh produces a detailed, per-stage execution trace for each query including coordinator and replica activity.
Question 3: In Cassandra, what is a 'wide partition' and why is it a potential problem?
- A partition stored across multiple data centers, increasing latency
- A partition with many rows that can cause memory pressure and slow reads (Correct answer)
- A partition key that is too long to index efficiently
- A partition replicated more times than the replication factor allows
Correct answer: A partition with many rows that can cause memory pressure and slow reads
Wide partitions can grow unboundedly and cause GC pressure, coordinator timeouts, and OOM errors during compaction.
Question 4: What is the role of the commit log in Apache Cassandra?
- Stores finalized SSTables for fast reads
- Provides durability by recording writes before they hit the memtable (Correct answer)
- Coordinates distributed transactions across nodes
- Tracks schema migrations and DDL changes
Correct answer: Provides durability by recording writes before they hit the memtable
The commit log is an append-only, durable write-ahead log that ensures no data is lost if a node crashes before its memtable is flushed.
Question 5: When should you use a Cassandra Materialized View instead of a denormalized table?
- When you need Cassandra to automatically maintain a read-optimized copy of a base table (Correct answer)
- When you want to reduce storage usage by sharing rows across tables
- When write throughput must exceed 1 million ops/sec
- When consistency level ONE is required for all reads
Correct answer: When you need Cassandra to automatically maintain a read-optimized copy of a base table
Materialized Views are automatically updated by Cassandra when the base table changes, eliminating the need for application-level dual writes.
Question 6: Which `nodetool` command shows you the token ranges and replica ownership for your cluster?
- nodetool ring (Correct answer)
- nodetool status
- nodetool describecluster
- nodetool getendpoints
Correct answer: nodetool ring
`nodetool ring` displays the token ring, showing each node's token position and whether it is up or down.
Question 7: What happens to tombstones in Cassandra if `gc_grace_seconds` has elapsed and compaction runs?
- Tombstones are converted into live null values
- Tombstones are permanently removed from the SSTable (Correct answer)
- Tombstones are replicated to all nodes for audit purposes
- Tombstones trigger an automatic repair before deletion
Correct answer: Tombstones are permanently removed from the SSTable
After gc_grace_seconds, Cassandra considers it safe to drop tombstones during compaction since all nodes should have seen the delete.
What does a Cassandra consistency level of QUORUM mean for a cluster with a replication factor of 3?