Advanced Concepts in Apache Cassandra and NoSQL Databases Quiz

  1. 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?

    1. Consistency and Availability; because nodes coordinate for every write operation.
    2. Consistency and Partition tolerance; as writes may be dropped to ensure agreement between partitions.
    3. Availability and Partition tolerance; since the cluster continues to serve requests even if consistency is reduced.
    4. Availability and Consistancy; as eventual synchronization ensures both.
    5. Partition and Accounting; ensuring all nodes tally requests correctly.
  2. 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?

    1. Store logs in a highly normalized table structure.
    2. Design a wide row with partition keys combining user ID and log date.
    3. Use a single partition key containing the entire log message.
    4. Assign a unique partition key for each log entry individually.
    5. Implement traditional foreign key joins between log and user tables.
  3. 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?

    1. Leveled Compaction; due to fast reads with smaller SSTables.
    2. Size-Tiered Compaction; as it efficiently handles write-heavy workloads and tombstone removals.
    3. TimeWindow Compaction; because it's best for uniformly distributed time-series data.
    4. Cumulative Compaction; since it prevents SSTable overlap.
    5. Incremental Compaction; because it merges SSTables in small batches.
  4. 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. 1
    2. 2
    3. 3
    4. All nodes in the cluster
    5. None
  5. Understanding Lightweight Transactions

    Which statement best explains how Cassandra ensures linearizable consistency for lightweight transactions using the Paxos protocol?

    1. All nodes reach consensus in a single phase, guaranteeing instant agreement.
    2. A read-before-write approach with four phases is employed, so that only one client wins on conflicting updates.
    3. It leverages time-based UUIDs to order concurrent updates without agreement.
    4. Each mutation is broadcast to all nodes, and majority voting is used afterward.
    5. Linearizble consistensy is achieved by combining write-ahead logging with sharding.