Question-: Which of the following statement/s is/are correct for Cassandra? A. Cassandra support linear performance when scaling nodes in a cluster. B. You can tune the consistency in Cassandra DB C. Every row in a table can have different number of columns. D. Across the Data center it has single point of failure.
Answer: A, B, C Exp: Following are the features of the Cassandra database you should keep in mind.
- Cassandra support JMX (Java Monitoring Extensions), to get the Matrics for performance, latency, system usage etc. And this matrics you can pass to other application as well for further analysis. - Cassandra DB has flexible data model, where each row in a partition can different number of columns. - Tunable consistency: If we want to replicate data across three nodes, we can have replication factor set as 3. While writing the data we have option whether to wait for all the three node acknowledgement for the write or as soon as data is written to first node should be acknowledged. As per the need we can tune the consistency. However, finally data will be stored all three nodes and that is known as eventual consistency. - Linear performance: If your 3 node Cassandra cluster support 6000 writes per second than 4 node will support 8000 writes, similarly adding 2 more nodes (total 6) will have 12000 writes per second. As many nodes you would have in the cluster it would linearly increase the performance. - Continuous available: As Cassandra has peer-to-peer replication of data across the nodes. And there is no single master. Hence, there is no single point of failure, even your cluster span across the data center. In the event of operation tie 1. Deletes will take precedence over inserts/updates. 2. If there are two updates, the one with the lexically larger value will wins.
Admin and Dev both
Question-: Which of the following statements are correct for querying data from a Cassandra table? A. In where clause you first provide the partition key and then you can have clustering columns. B. You cannot perform equality or range queries on clustering columns. C. All equality comparisons must come before inequality comparisons. D. Range searches are binary search.
Answer: A, C, D Exp: We must know the following things while querying the table which has partition key and clustering column. - While querying in where clause we should first use the partition key. - Then in the where clause we can have Clustering columns. - We can perform equality (=) and range queries (<,>) on clustering columns. - Also keep in mind that while querying data equality comparisons must come before inequality comparisons. - As we define clustering columns then data would always be sorted on the disk. And while searching the data if there is a range search it would do the binary search and then apply the linear search. Admin Only
Question-: Which of the following statements are correct for the storage layer of the Apache Cassandra node? A. Cassandra node must have locally attached storage. B. Cassandra node can work with Direct Attached Storage. C. Cassandra best work the SAN (Storage Area Network) D. Cassandra can work with the SSD E. Cassandra works well with the Network attached storage.
Answer: B, D Exp: Cassandra database works well with the locally attached storage but this is not the must. It can have direct attached storage as well. Hence, option-2 is correct.
Cassandra should never be setup with SAN (Storage area network). Hence, option-3 is not at all correct. Yes, it is a good choice having an SSD for storage layer. Hence, option-4 is correct.
Cassandra is does not perform better with the network attached storage and must be avoided.