The CAP theorem shows that, when the network partitions, a distributed database system cannot be both strongly consistent and available. Strong consistency (as in Spanner or CockroachDB) globally synchronises every update. This avoids the opportunity for error due to concurrency anomalies, but reduces availability, and increases latency. Conversely, eventually-consistent systems (e.g. Riak or Cassandra) are available and responsive, but the developer must compensate for the database's anomalies in order to avoid violating the application's invariants.
We propose a new approach that is based on application requirements, “Just-Right Consistency” (JRC), ensuring just enough synchronisation to ensure that the application remains correct.
This talk first presents the principles of JRC. Then we present the open-source Antidote database, designed accordingly. Antidote supports concurrent updates and merges them according to their semantics. It guarantees the Transactional Causal Consistency (TCC) model, by which the application can group related updates into an atomic transaction, and there are no ordering anomalies; TCC is the strongest model that does not compromise availability. Antidote encapsulates the synchronisation required by some numerical invariants into a data type (the Bounded Counter). Finally, we present the CISE tool that aids the developer select the consistency level of each update, synchronising only when strictly necessary to the application's semantics.
Presented at Paris Open Source Summit 2018http://www.opensourcesummit.paris/