Cassandra: 3 Ways Cassandra Keeps Data in Sync
3 Ways Cassandra Keeps Data in Sync
There are 3 mechanisms for making sure that your data stays in sync and consistent.
- Read Repair
- Hinted Handoff
- Anti-Entropy Repair
Read Repair
Read Repairs compare values and updates (repairs) any out of sync. Read Repairs happen when a read is done — the coordinator node then compares the data from all the remaining replicas that own the row in the background and if they are inconsistent, issues writes to the out-of-date replicas to update the row with the most recently written values.
Read Repairs can be configured per column family and is enabled by default.
There are 2 types of read repair, foreground and background. Foreground means blocking. We complete all operations before returning to the client. Background means non-blocking. We begin the background repair operation and then return to the client before it has been completed.
Foreground (Blocking) Read Repair
Foreground read repair is always performed on queries which use a consistency level greater than ONE or LOCAL_ONE.