Apache Cassandra

Cassandra is NoSQL database management system designed for handling a high volume of structured data. If you are preparing for a role in Apache Cassandra, then you will find these interview questions helpful.

Q.1 Explain what is Cassandra?
Cassandra is an open source data storage system for inbox search, developed at Facebook and it's designed for storing and managing large amounts of data across commodity servers. It can serve as both. Real time data store system for online applications, and Also for business intelligence system as a read intensive database.
Q.2 State the use of Cassandra and why to use Cassandra?
Cassandra was designed to handle big data workloads over the multiple nodes without any single point of failure. The various factors responsible for using Cassandra are:
It is fault tolerant and consistent
Gigabytes to petabytes scalabilities
It is a column-oriented database
No single point of failure
No need for separate caching layer
Flexible schema design
It has easy data distribution, flexible data storage, and fast writes
It supports ACID (Atomicity, Consistency, Isolation, and Durability)properties
Multi-data center and cloud capable
Data compression.
Q.3 Explain what is composite type in Cassandra?
Explain what is composite type in Cassandra?
Q.4 How Cassandra stores data?
All data stored as bytes
Cassandra ensures those bytes are encoded as per requirement, when you specify Validators
Then a collation orders the column based on the ordering specific to the encoding
While with a particular encoding composite are just byte arrays, for each component it stores a two byte length followed by the byte encoded component followed by a termination bit.
Q.5 Please mention the main components of Cassandra Data Model?
The main components of Cassandra Data Model are:
Key space
Column & Family
Q.6 Explain what is a column family in Cassandra?
A collection of Rows in Cassandra are referred as column family.
Q.7 Explain what is a cluster in Cassandra?
A cluster is a container for key spaces. Cassandra database is distributed over several machines that function together. The cluster is the outermost container which manages the nodes in a ring format and assigns data to them. These nodes have a replica which takes charge in case of failure of data handling.
Q.8 List out the other components of Cassandra?
The other components of Cassandra are
Data Center
Commit log
Bloom Filter
Q.9 Explain what is a keyspace in Cassandra?
In Cassandra, a keyspace is a namespace determining the data replication on nodes. A cluster consist of one keyspace per node.
Q.10 Give the syntax to create keyspace in Cassandra?
Syntax for creating keyspace in Cassandra is
Q.11 Mention the values that are stored in the Cassandra Column?
In Cassandra Column, basically there are three values:
Column Name
Time Stamp
Q.12 Mention when you can use Alter keyspace?
To change properties such as the number of replicas and the durable_write of a keyspace ALTER KEYSPACE can be used.
Q.13 Explain what is Cassandra-Cqlsh?
Cassandra-Cqlsh is a query language that enabling the users to communicate with its database. By using Cassandra cqlsh, one can do:
Define a schema
Insert a data and
Execute a query.
Q.14 Explain how Cassandra writes changed data into commitlog?
Cassandra concatenate changed data to commitlog
Commitlog acts as a crash recovery log for data
Until the changed data is concatenated to commitlog write operation will be never considered successful
Data will not be lost once commitlog is flushed out to file.
Q.15 Explain how Cassandra delete Data?
SSTables are permanent and cannot remove a row from SSTables. Cassandra assigns the column value with a special value called Tombstone when a row needs to be deleted.
Therefore, when the data is read, the Tombstone value is considered as deleted.
Q.16 State the usage of "void close()" method?
In Cassandra, to close the current session instance the void close() method is used.
Q.17 To start the cqlsh prompt state the command used?
The cqlsh command is used to initiate the cqlsh prompt.
Q.18 Give the usage of "cqlsh-version" command?
The "cqlsh-version" command is used to provide the version of the cqlsh one is using.
Q.19 Does Cassandra work on Windows?
Yes. it's is compatible with the Windows and works pretty well. Now its Linux and Window compatible version are available too.
Q.20 What is Kundera in Cassandra?
Kundera is an object-relational mapping (ORM) implementation, in the Cassandra which is written using Java annotations.
Q.21 What do you understand by Thrift in Cassandra?
Thrift is the name of RPC client which is utilized to communicate with the Cassandra Server.
Q.22 What is Hector in Cassandra?
Hector was one of the early Cassandra clients. It is an open source project using the MIT license written in Java.
Q.23 State some of the features of Apache Cassandra.
Some of the features of Apache Cassandra -
1. High Scalability
2. High fault tolerant
3. Flexible Data storage
4. Easy data distribution
5. Tunable Consistency
6. Efficient Wires
7. Cassandra Query Language
Q.24 How would you define NoSQL Database?
NoSQL Database is a database that deals with the non-relational database. It is also known as a Not only SQL database. NoSQL Database provides a mechanism to store and retrieve different type of data that includes images, sounds and more.
Q.25 What are the primary features of any NoSQL database?
Some of the primary features of any NoSQL database are -
1. Schema Agnostic
2. AutoSharding and Elasticity
3. Highly Distributable
4. Easily Scalable
5. Integrated Caching
Q.26 Which query language is used in Cassandra Database?
Cassandra query language' is used for Cassandra Database. Cassandra query language is an interface that a user uses to access the database and is basically a communication medium. Such that all the operations are carried out from this panel.
Q.27 What is the primary objective of creating Cassandra?
The primary objective of crating Cassandra is to handle a large amount of data. Also the objective ensures fault tolerance with the swift transfer of data.
Q.28 What do you understand by Document Store DB?
Data record is the JSON/XML representation of key-value pairs such that every record can have a different set of fields. Document DBs are similar to Key-value pairs, but the only difference is that the key is associated with a document
Q.29 What is the purpose of CQLSH?
Cassandra-CQLSH is a defined query language which enables users to communicate with its database. The purpose of using Cassandra CQLSH is to -
1. Define a schema
2. Insert a data
3. Execute a query
Q.30 How do you define is a YML file in Cassandra?
Cassandra YAML file is the main configuration file for Cassandra. Therefore after changing properties in the cassandra.yaml file, we must restart the node for the changes to take effect.
Get Govt. Certified Take Test