Database Reference
In-Depth Information
Consistency maintenance features
In the previous section, we discussed read and write consistency in depth, and one thing
that came clear is that Cassandra doesn't provide or work towards total consistency at the
time the read or write operation is performed; it executes and completes the request as per
client's consistency specifications. Another feature is eventual consistency , which high-
lights that there is some magic behind the veil that guarantees that eventually all data will
be consistent. Now this magic is performed by certain components within Cassandra, and
some are mentioned as follows:
Read repair : This service ensures that data across all the replicas is and up to date.
This way, the row is consistent and has been updated with recent values across all
replicas. This operation is executed by a job. Cassandra is running to execute re-
pair read operation issued by the coordinator.
Anti-entropy repair service : This service ensures that the data that's not read very
frequently, or when a downed host joins back, is in consistent a state. This is a reg-
ular cluster maintenance operation.
Hinted handoff : This is another unique and wonderful operation on Cassandra.
When the write operation is executed, the coordinator issues a write operation to
all replicas, irrespective of the consistency specified and waits for an acknowledge-
ment. As soon as the acknowledgement count reaches the value mentioned on con-
sistency of the operation, the thread is completed and the client is notified about its
success. On the remaining replicas, the values are written using hinted handoffs.
The hinted handoff approach is a savior when a few nodes are down. Let's say one
of the replicas is down and a write operation is executed with a consistency of
ANY ; in that case, one replica takes the write operation and hints to the neighboring
replicas, which are currently down. When the downed replicas are revived, then
the values are written back to them by taking hints from live replicas.
Search WWH ::




Custom Search