MCQs on Cassandra Architecture | Cassandra


Cassandra is a highly scalable, distributed NoSQL database designed to handle large amounts of data across many commodity servers. In Chapter 2, we explore key concepts such as peer-to-peer architecture, data distribution, replication, consistency, and the mechanisms like gossip protocol, commit logs, and SSTables. These principles ensure Cassandra’s reliability and scalability.


Peer-to-Peer Distributed System

  1. What is the fundamental architecture of Cassandra?
    a) Master-Slave
    b) Peer-to-Peer
    c) Client-Server
    d) Tree-based
  2. In Cassandra, data is distributed across:
    a) Master nodes
    b) Slave nodes
    c) Peer nodes
    d) Database clusters
  3. What does the peer-to-peer architecture in Cassandra ensure?
    a) High availability and fault tolerance
    b) Centralized management
    c) Low storage requirements
    d) Limited scalability
  4. In a peer-to-peer system, every node in Cassandra is:
    a) A master node
    b) Responsible for a specific data range
    c) Equal and independent
    d) A slave node
  5. Which of the following is true about the communication between nodes in Cassandra?
    a) Communication happens through a single central server
    b) Nodes exchange data in a peer-to-peer manner
    c) Each node is connected to only one other node
    d) Data transfer only happens on the master node

Partitions and Data Distribution

  1. Cassandra stores data in what form?
    a) Tables
    b) Rows and columns
    c) Partitions
    d) Data blocks
  2. How does Cassandra distribute data across nodes?
    a) By using a hashing mechanism
    b) By using a time-based approach
    c) By distributing data randomly
    d) By storing data in specific data centers
  3. Which component is used to determine where data should be stored on a node?
    a) Consistent Hashing
    b) Data Masking
    c) Distributed Indexing
    d) Sharding Algorithm
  4. What is a partition key in Cassandra?
    a) A key used for encryption
    b) A key that determines the distribution of data
    c) A key for data compression
    d) A key used for indexing
  5. The process of dividing data into partitions in Cassandra helps with:
    a) Improved data security
    b) Scalability and performance
    c) Data backup management
    d) Faster queries

Replication and Consistency

  1. Cassandra uses replication to:
    a) Ensure data consistency
    b) Improve query performance
    c) Handle system failures
    d) All of the above
  2. What is the default replication factor in Cassandra?
    a) 1
    b) 2
    c) 3
    d) 5
  3. In Cassandra, consistency level refers to:
    a) The number of replicas of data
    b) The freshness of the data
    c) The level of agreement required between nodes for an operation
    d) The speed of queries
  4. Which of the following consistency levels in Cassandra ensures that a write is acknowledged by all nodes?
    a) ONE
    b) QUORUM
    c) ALL
    d) LOCAL_QUORUM
  5. What happens when a node in Cassandra becomes unavailable?
    a) Data becomes inconsistent
    b) The node is removed permanently
    c) Replication ensures data availability
    d) Data is lost

Gossip Protocol and Failure Detection

  1. What is the Gossip Protocol in Cassandra used for?
    a) Data encryption
    b) Node communication and failure detection
    c) Query optimization
    d) Load balancing
  2. In Cassandra, the Gossip Protocol helps nodes to:
    a) Track each other’s state
    b) Share data between regions
    c) Generate encryption keys
    d) Cache query results
  3. Failure detection in Cassandra is managed by:
    a) Centralized monitoring tools
    b) Gossip Protocol
    c) Manual node inspection
    d) Hardware redundancy
  4. What happens when a node fails in Cassandra?
    a) Data is lost permanently
    b) The node is immediately replaced
    c) The system continues to work with replicas
    d) All nodes go down
  5. How does Cassandra detect failed nodes?
    a) Using a heartbeat signal
    b) Through a leader election process
    c) By querying the system logs
    d) Using the Gossip Protocol

Commit Logs and SSTables

  1. What is the purpose of the commit log in Cassandra?
    a) To store query results
    b) To log every write operation for durability
    c) To manage node communication
    d) To manage backups
  2. Commit logs are written to disk before:
    a) Data is stored in memory
    b) Data is read by users
    c) Data is replicated
    d) Data is written to SSTables
  3. What is the structure used by Cassandra to store data on disk?
    a) Filesystems
    b) SSTables
    c) Tablespaces
    d) Data partitions
  4. What is an SSTable in Cassandra?
    a) A file containing immutable data
    b) A temporary storage format
    c) A file that stores commit logs
    d) A type of memory structure
  5. SSTables are used in Cassandra because they allow for:
    a) Frequent data updates
    b) Efficient data reads and writes
    c) In-memory data caching
    d) Enhanced encryption
  6. After a write operation in Cassandra, data is first stored in:
    a) SSTables
    b) Commit logs
    c) Memory tables (Memtables)
    d) Backup files
  7. When does Cassandra flush data from memory to an SSTable?
    a) When the memory table exceeds a certain size
    b) Every 10 minutes
    c) When the system reaches a consistent state
    d) Only during backups
  8. What happens when an SSTable reaches its limit in Cassandra?
    a) It is automatically deleted
    b) It is merged with other SSTables
    c) It is backed up immediately
    d) It becomes read-only
  9. What is a key benefit of using SSTables in Cassandra?
    a) Quick node replacement
    b) Efficient disk storage and read access
    c) Faster network replication
    d) Simple encryption of data
  10. How does Cassandra manage updates to data in SSTables?
    a) It directly overwrites old data
    b) It marks old data for deletion and writes new data
    c) It moves old data to a backup file
    d) It compresses old data

Answers

QnoAnswer
1b) Peer-to-Peer
2c) Peer nodes
3a) High availability and fault tolerance
4c) Equal and independent
5b) Nodes exchange data in a peer-to-peer manner
6c) Partitions
7a) By using a hashing mechanism
8a) Consistent Hashing
9b) A key that determines the distribution of data
10b) Scalability and performance
11d) All of the above
12c) 3
13c) The level of agreement required between nodes for an operation
14c) ALL
15c) Replication ensures data availability
16b) Node communication and failure detection
17a) Track each other’s state
18b) Gossip Protocol
19c) The system continues to work with replicas
20d) Using the Gossip Protocol
21b) To log every write operation for durability
22b) Data is written to SSTables
23b) SSTables
24a) A file containing immutable data
25b) Efficient data reads and writes
26c) Memory tables (Memtables)
27a) When the memory table exceeds a certain size
28b) It is merged with other SSTables
29b) Efficient disk storage and read access
30b) It marks old data for deletion and writes new data

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top