Cassandra medium
Cassandra supports 'Lightweight Transactions' (LWT) like `IF NOT EXISTS`. Under the hood, this uses the Paxos protocol. What is the fundamental impact on write latency?
- A It is faster because Paxos ignores replication and writes to only one node.
- B It is roughly 4x slower because Paxos requires multiple round-trips (Prepare, Promise, Accept, Learn) to achieve consensus before the actual write.
- C It has no impact on performance because Paxos is implemented in the hardware network switches.
- D LWT is only allowed for data that is less than 1KB in size.
Answer: B. It is roughly 4x slower because Paxos requires multiple round-trips (Prepare, Promise, Accept, Learn) to achieve consensus before the actual write.
Standard writes are 'Fire and Forget' (one round trip). LWT ensures 'Linearizability' (preventing race conditions) but at a high cost. LWT should be used sparingly for 'Control Plane' tasks (like creating users) rather than high-velocity data ingestion.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a Cassandra Keyspace, what does a 'Replication Factor of 3' specifically guarantee for your data redundancy?
- Unlike a Leader-Follower architecture (like MySQL or Redis), how does Cassandra maintain high availability within its node cluster?
- Cassandra Query Language (CQL) looks similar to SQL. What is a fundamental SQL feature that CQL does NOT support to ensure distributed performance?
- What is the critical architectural function of the 'Partition Key' in a Cassandra table?
- Apache Cassandra is fundamentally designed as which architectural category of NoSQL database?
- An extreme financial trading application requires 'Batch' sync for the Commit Log. What is the fundamental throughput limitation introduced by this setting?