Introduction
Welcome to this quiz on Apache Cassandra, a powerful NoSQL database designed for handling large amounts of data across many servers without any single point of failure. This quiz is created to help you test your understanding of Cassandra, whether you're just starting to learn about it or want to review key concepts.
The quiz consists of multiple-choice questions covering various aspects of Cassandra, including its architecture, data model, query language, and features like replication and consistency. Each question comes with a clear explanation to help you understand the correct answers.
Take your time with each question, and don't worry if you get some wrong. The goal is to learn and solidify your knowledge. Good luck!
1. What type of database is Cassandra?
Answer:
Explanation:
Cassandra is a column-oriented NoSQL database designed to manage large volumes of structured data across many servers.
2. Which language is used to query Cassandra?
Answer:
Explanation:
Cassandra Query Language (CQL) is a query language for the Cassandra database.
3. Which of the following best describes the architecture of Cassandra?
Answer:
Explanation:
Cassandra follows a peer-to-peer architecture where all nodes in the cluster are treated equally, avoiding single points of failure.
4. Which company originally developed Cassandra?
Answer:
Explanation:
Cassandra was originally developed by Facebook to power their Inbox search feature.
5. In Cassandra, what does the term "compaction" refer to?
Answer:
Explanation:
Compaction in Cassandra refers to the process of reclaiming space by merging SSTables and discarding duplicate data.
6. Which of the following ensures high availability in Cassandra?
Answer:
Explanation:
To ensure high availability, data is replicated across multiple nodes in a Cassandra cluster.
7. Which consistency level ensures the fastest write operations in Cassandra?
Answer:
Explanation:
With a consistency level of ONE, a write must be written to the commit log and memtable of at least one replica node.
8. Which data structure is used to store data in memory in Cassandra?
Answer:
Explanation:
In Cassandra, data is written and then stored in a memory structure called the memtable.
9. What does SSTable stand for in the context of Cassandra?
Answer:
Explanation:
In Cassandra, SSTable stands for Sorted String Table, which is an immutable data file to which Cassandra writes memtables periodically.
10. In Cassandra, a ‘Keyspace’ is equivalent to what in relational databases?
Answer:
Explanation:
In Cassandra, a 'Keyspace' is similar to a 'Database' in relational DBMS. It's a namespace to hold a set of tables.
11. What is the primary write destination in Cassandra?
Answer:
Explanation:
In Cassandra, the primary write destination is the commit log. Once the write has been committed to the log, it's then written to the memtable.
12. Which of the following is NOT a component of Cassandra's data model?
Answer:
Explanation:
Cassandra's data model comprises columns, column families, and super columns. "Keyset" is not a term associated with its data model.
13. What is the default port number on which Cassandra's CQL native transport listens?
Answer:
Explanation:
By default, Cassandra's CQL native transport listens on port 9042. This is the port that client libraries use to connect to the Cassandra cluster.
14. Which CQL query is used to retrieve all columns of all rows from a table named "users"?
Answer:
Explanation:
In Cassandra's CQL, the correct syntax to retrieve all columns of all rows from a table is SELECT * FROM <table_name>;.
15. In CQL, what is the correct data type to store a UUID (Universally Unique Identifier)?
Answer:
Explanation:
In CQL, the UUID data type is used to store universally unique identifiers.
16. Which CQL command is used to modify data in an existing row or rows of a table?
Answer:
Explanation:
The UPDATE command is used in CQL to modify data in an existing row or rows of a table.
17. To delete all rows from a table named "employees" without removing the table itself, which query should be used?
Answer:
Explanation:
The TRUNCATE command is used to delete all rows from a table while leaving the table structure intact.
18. What is the replication strategy in Cassandra that allows you to specify the number of replicas in each data center?
Answer:
Explanation:
NetworkTopologyStrategy allows you to specify the number of replicas in each data center, providing more control over data replication in multi-datacenter deployments.
19. What happens when a write request is sent to a Cassandra node that is currently down?
Answer:
Explanation:
In Cassandra, if a node is down, the write request is sent to another available node in the cluster to ensure the write is completed.
20. What is the purpose of the ‘nodetool’ utility in Cassandra?
Answer:
Explanation:
The nodetool utility is used in Cassandra to manage and monitor nodes in the cluster, including checking the status of nodes and performing administrative tasks.
21. What is the consistency level in Cassandra that ensures all replicas respond before the operation is considered successful?
Answer:
Explanation:
The ALL consistency level ensures that all replicas must respond before the operation is considered successful, providing the highest consistency but at the cost of latency.
22. Which of the following is a valid primary key definition in a CQL table?
Answer:
Explanation:
All the given options are valid primary key definitions in Cassandra, depending on the desired partitioning and clustering key strategy.
23. In Cassandra, what does the ‘Tombstone’ refer to?
Answer:
Explanation:
In Cassandra, a tombstone is a marker used to indicate that a piece of data has been deleted. It helps in eventual consistency by ensuring that the deletion is propagated across all replicas.
24. What is the function of the ‘gossip’ protocol in Cassandra?
Answer:
Explanation:
The gossip protocol in Cassandra allows nodes to communicate with each other and share state information, ensuring that the cluster remains synchronized and that each node has an updated view of the cluster state.
25. Which of the following is a valid statement for creating a keyspace in Cassandra?
Answer:
Explanation:
The correct CQL statement to create a keyspace in Cassandra is using the CREATE KEYSPACE syntax, along with the replication strategy and factor.
Conclusion
We hope this quiz helped you better understand Apache Cassandra and its key features. By going through these questions, you should now have a clearer understanding of Cassandra's architecture, data model, and operations. Keep practicing and reviewing these concepts to solidify your knowledge. Good luck with your continued learning journey!
Comments
Post a Comment
Leave Comment