DS201 Study Notes: Cassandra Hinted Handoff

DS201 course study notes on Cassandra's Hinted Handoff: how it ensures data durability when replica nodes are temporarily unavailable.

Study notes from DS201: Foundations of Apache Cassandra™ and DataStax Enterprise.

Hinted Handoff

Hinted Handoff is one of Cassandra’s fault tolerance features that ensures data durability when replica nodes are temporarily unavailable during write operations.

How It Works

Consider the case where a write request arrives at a coordinator node, and some of the replica nodes that should receive the data are down or temporarily disconnected from the network.

Normally, Cassandra waits for responses from the required number of replicas based on the configured Consistency Level. However, if the Consistency Level cannot be met due to downed nodes, the write fails.

When Hinted Handoff is enabled, the coordinator node temporarily stores data destined for the downed replica node on another available node (hint node). This stored data is called a “hint.”

When the downed replica node recovers and rejoins the cluster, the hint node transfers the stored hint information to the original replica node. This ensures that writes that would have been lost during the downtime are eventually reconciled after recovery.

Benefits and Considerations

  • Benefits:
    • Improves write durability during temporary node failures or network partitions.
    • Increases availability by avoiding write errors on the client side.
  • Considerations:
    • Hinted Handoff is only a temporary solution. If a node is down for an extended period or a large volume of hints accumulates, it may consume disk space on the hint node or take time to transfer data during recovery.
    • It is enabled by default, but the settings can be changed in cassandra.yaml. However, unless there is a specific reason, it is recommended to keep the default settings.

Hinted Handoff is one of the key features supporting Cassandra’s “Eventual Consistency” model, contributing to improved system availability and durability.