Interview :: Cassandra
In Cassandra, a keyspace is a namespace that determines data replication on nodes. A cluster contains of one keyspace per node.
In Cassandra, composite keys are used to define key or a column name with a concatenation of data of different type. There are two types of Composite key in Cassandra:
- Row Key
- Column Name
Data replication is an electronic copying of data from a database in one computer or server to a database in another so that all users can share the same level of information. Cassandra stores replicas on multiple nodes to ensure reliability and fault tolerance. The replication strategy decides the nodes where replicas are placed.
What is node in Cassandra?
In Cassandra, node is a place where data is stored.
Data center is a complete data of clusters.
In Cassandra, commit log is a crash-recovery mechanism. Every write operation is written to the commit log.
What do you mean by column family in Cassandra?
Column family is a table in RDMS that contains an ordered collection of rows.
Consistency in Cassandra specifies how to synchronize and up to date a row of Cassandra data and its replicas.
It supports two consistencies: Eventual Consistency and Strong Consistency.
The eventual consistency is used when no new updates are made on a given data item, all accesses return the last updated value eventually. Systems with eventual consistency are known to have achieved replica convergence.
Cassandra supports the following conditions for strong consistency:
R + W > N
Here
N: Number of replicas
W: Number of nodes that need to agree for a successful write
R: Number of nodes that need to agree for a successful read
Tunable Consistency is a phenomenal characteristic of Cassandra which makes it a popular choice. Consistency refers to the up-to-date and synchronized data rows on all their replicas. Cassandra's Tunable Consistency facilitates users to select the consistency level best suited for their use cases.