CAP Theorem Application in Cassandra
When an Apache Cassandra cluster is experiencing a network partition between two data centers, which pair within the CAP theorem is primarily favored and why?
- Consistency and Availability; because nodes coordinate for every write operation.
- Consistency and Partition tolerance; as writes may be dropped to ensure agreement between partitions.
- Availability and Partition tolerance; since the cluster continues to serve requests even if consistency is reduced.
- Availability and Consistancy; as eventual synchronization ensures both.
- Partition and Accounting; ensuring all nodes tally requests correctly.
Data Modeling in Wide-Column Stores
In a scenario where user activity logs must be stored for high-speed retrieval and efficient time-series queries, which data modeling approach best utilizes Apache Cassandra's storage format?
- Store logs in a highly normalized table structure.
- Design a wide row with partition keys combining user ID and log date.
- Use a single partition key containing the entire log message.
- Assign a unique partition key for each log entry individually.
- Implement traditional foreign key joins between log and user tables.
Compaction Strategies
Given a table that receives heavy write workloads interleaved with frequent deletions, which compaction strategy in Apache Cassandra is the most suitable and why?
- Leveled Compaction; due to fast reads with smaller SSTables.
- Size-Tiered Compaction; as it efficiently handles write-heavy workloads and tombstone removals.
- TimeWindow Compaction; because it's best for uniformly distributed time-series data.
- Cumulative Compaction; since it prevents SSTable overlap.
- Incremental Compaction; because it merges SSTables in small batches.
Tunable Consistency Levels
If a client issues a write request with QUORUM consistency to Cassandra’s replication factor of 3, how many replica nodes must acknowledge the write for it to be considered successful?
- 1
- 2
- 3
- All nodes in the cluster
- None
Understanding Lightweight Transactions
Which statement best explains how Cassandra ensures linearizable consistency for lightweight transactions using the Paxos protocol?
- All nodes reach consensus in a single phase, guaranteeing instant agreement.
- A read-before-write approach with four phases is employed, so that only one client wins on conflicting updates.
- It leverages time-based UUIDs to order concurrent updates without agreement.
- Each mutation is broadcast to all nodes, and majority voting is used afterward.
- Linearizble consistensy is achieved by combining write-ahead logging with sharding.