# ScyllaDB Anti-Entropy

ScyllaDB replicates data according to [eventual consistency](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Eventual-Consistency).  This means that, in ScyllaDB, when considering the [CAP Theorem](https://docs.scylladb.com/manual/master/reference/glossary.md#term-CAP-Theorem), availability and partition tolerance are considered a higher priority over consistency. Although ScyllaDB’s tunable consistency allows users to make a tradeoff between availability and consistency,  ScyllaDB’s [consistency level](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Consistency-Level-CL) is tunable per query.

However, over time, there can be a number of reasons for data inconsistencies, including:

1. a down node;
2. a network partition;
3. dropped mutations;
4. process crashes (before a flush);
5. a replica that cannot write due to being out of resources;
6. file corruption.

To mitigate [entropy](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Entropy), or data inconsistency, ScyllaDB uses a few different processes.  The goal of ScyllaDB [anti-entropy](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Anti-entropy) - based on that of Apache Cassandra  -  is to compare data on all replicas, synchronize data between all replicas,  and, finally,  ensure each replica has the most recent data.

Anti-entropy measures include *write-time* changes such as [hinted handoff](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Hinted-Handoff), *read-time* changes such as [read repair](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Read-Repair), and finally, periodic maintenance via [repair](https://docs.scylladb.com/manual/master/reference/glossary.md#term-Repair).

* [ScyllaDB Hinted Handoff](https://docs.scylladb.com/manual/master/architecture/anti-entropy/hinted-handoff.md) - High-Level view of ScyllaDB Hinted Handoff
* [ScyllaDB Read Repair](https://docs.scylladb.com/manual/master/architecture/anti-entropy/read-repair.md) - High-Level view of ScyllaDB Read Repair
* [ScyllaDB Repair](https://docs.scylladb.com/manual/master/operating-scylla/procedures/maintenance/repair.md) - Description of ScyllaDB Repair

Also learn more in the [Cluster Management, Repair and ScyllaDB Manager lesson](https://university.scylladb.com/courses/scylla-operations/lessons/cluster-management-repair-and-scylla-manager/topic/cluster-management-repair-and-scylla-manager/) on ScyllaDB University.

Copyright

© 2016, The Apache Software Foundation.

Apache®, Apache Cassandra®, Cassandra®, the Apache feather logo and the Apache Cassandra® Eye logo are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
