possible, and consistent when necessary • AntidoteDB The first database that provides transactions with strong semantics, targeted at the JRC approach 2
possible, and consistent when necessary • AntidoteDB The first database that provides transactions with strong semantics, targeted at the JRC approach • Moving forward Antidote’s path forward from research to company and product 2
other replicas? [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
operation Maintains “single system image” • Spanner/F1, serializability model Coordination is expensive; Spanner typically has to wait 100ms to commit an update transaction [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
operation Maintains “single system image” • Spanner/F1, serializability model Coordination is expensive; Spanner typically has to wait 100ms to commit an update transaction Over-conservative, but easy to program! [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Dynamo Operations issued against local copy, and across the cluster in parallel [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Dynamo Operations issued against local copy, and across the cluster in parallel • Local operation only, asynchronous propagation Stale reads and write conflicts will occur without synchronization [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Dynamo Operations issued against local copy, and across the cluster in parallel • Local operation only, asynchronous propagation Stale reads and write conflicts will occur without synchronization Available, but difficult to program! [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
AP [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
CP AP [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Low cost High availability CP AP [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Low cost High availability Anomalies CP AP [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452]
Low cost High availability Anomalies CP AP False dichotomy! [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452] • No “one-size-fits-all” consistency model Choosing either model will either be over-conservative or risk anomalies
Low cost High availability Anomalies CP AP False dichotomy! [Photo: http://vignette3.wikia.nocookie.net/the-titans-rp-and-information/images/f/f5/Blank-World-map2.gif/revision/latest/scale-to-width-down/1280?cb=20141016203452] • No “one-size-fits-all” consistency model Choosing either model will either be over-conservative or risk anomalies • Application-level invariants Instead, tailor consistency choices based on application- level invariants for each operation
that are correct should maintain correctness under concurrency • AP-compatible invariants Strongest AP model; invariants that only require “one way” communications 13
that are correct should maintain correctness under concurrency • AP-compatible invariants Strongest AP model; invariants that only require “one way” communications • CAP-sensitive invariants Transactions that require coordination; “two way” communication invariants 13
that are correct should maintain correctness under concurrency • AP-compatible invariants Strongest AP model; invariants that only require “one way” communications • CAP-sensitive invariants Transactions that require coordination; “two way” communication invariants • Tools for analysis and verification Identify and verify application has sufficient synchronization to ensure application invariants 13
National Joint Medicine Card; operating 24x7 since 2013 for 6 million Danish citizens • Lifecycle management for prescriptions Involves patient, pharmacy, and doctor management around active prescriptions in Denmark 15
National Joint Medicine Card; operating 24x7 since 2013 for 6 million Danish citizens • Lifecycle management for prescriptions Involves patient, pharmacy, and doctor management around active prescriptions in Denmark • Assumed correct in isolation “Correct-Individually”, C in ACID, each operation ensures application-level invariants 15
National Joint Medicine Card; operating 24x7 since 2013 for 6 million Danish citizens • Lifecycle management for prescriptions Involves patient, pharmacy, and doctor management around active prescriptions in Denmark • Assumed correct in isolation “Correct-Individually”, C in ACID, each operation ensures application-level invariants 15 • create-prescription Create prescription for patient, doctor, pharmacy • update-prescription-medication Add or increase medication to prescription • process-prescription Deliver a medication by a pharmacy • get-*-prescriptions Query functions to return information about prescriptions
and reference it by a patient • Joint update [atomicity] Create prescription, then update doctor, patient, and pharmacy • Precondition check [if, then] Medication should not be over delivered 16
synchronization in the critical path • Asynchronous operation Updates are fast, available, and exploit concurrency • Compatible invariants Relative order and joint update invariants can be preserved 18
How do we deterministically pick a value to keep? Do we use a timestamp? (like Cassandra, and drop a value?) Timestamps make concurrent operations commute but fail to capture intent.
the causal order • Strongest available AP model Always able to return some compatible version for an object • Secondary indexing Causal consistency is sufficient for providing secondary indexing in an AP database 44
Incorrect outcome violating non-negative invariant. Precondition is NOT stable under concurrent fulfillment. • Forbid concurrency Prevent operations from proceeding without synchronization to enforce invariant • Allow concurrency and remove invariant Allow operation to proceed, knowing that the invariant may be violated under concurrent operations
invariant • Convergence Concurrent effects commute • Precondition stability Preconditions are stable under every pair of concurrent operations 81 If satisfied, invariant is guaranteed with concurrency.
of the Riak Core distributed systems framework • Transactional Causal Consistency Only industrial-grade database providing both causal consistency and all-or-nothing transactions 83
of the Riak Core distributed systems framework • Transactional Causal Consistency Only industrial-grade database providing both causal consistency and all-or-nothing transactions • Alpha release available Currently under development, but an alpha release of the product is available on GitHub 83
= antidote:update_objects(ignore, [], [{User1, assign, {["Michel", “michel@blub.org”], ClientIdentifier}}]), {ok, Result, Time2} = antidote:read_objects( ignore, [], [User1]). Use the update API to assign a value to this register.
with a given snapshot time and return a transaction identifier. {ok, TxId} = antidote:start_transaction(Timestamp, []), {ok, _} = antidote:read_objects([Set], TxId), ok = antidote:update_objects([{Set, add, "Java"}], TxId), {ok, _} = antidote:commit_transaction(TxId).
ok = antidote:update_objects([{Set, add, "Java"}], TxId), {ok, _} = antidote:commit_transaction(TxId). Transaction API 96 Read objects using the interactive transaction API.
ok = antidote:update_objects([{Set, add, "Java"}], TxId), {ok, _} = antidote:commit_transaction(TxId). Transaction API 97 Update objects using the interactive transaction API.
ok = antidote:update_objects([{Set, add, "Java"}], TxId), {ok, _} = antidote:commit_transaction(TxId). Transaction API 98 Once finished updating, commit the transaction.
ok = antidote:update_objects([{Set, add, "Java"}], TxId), {ok, _} = antidote:commit_transaction(TxId). Transaction API 98 Once finished updating, commit the transaction. Transactions read causally consistent snapshots and updates are applied atomically.
600 700 800 1 x 5 1 x 10 1 x 25 2 x 25 3 x 25 1 x 5 1 x 10 1 x 25 2 x 25 3 x 25 1 x 5 1 x 10 1 x 25 2 x 25 3 x 25 1 x 5 1 x 10 1 x 25 2 x 25 3 x 25 99(1) 90(10) 75(25) 50(50) read(update) ratio DCs × Servers LWW registers 100k keys/partition power law distribution
the datacenter and assumes only geo- replication at the moment • ACID transactions For Antidote to provide all of JRC, it needs ACID transaction support: no research needed, only implementation 102
build a database requiring reduced synchronization (SyncFree FP7) with Basho, Rovio, and Trifork • Research ahead LightKone (H2020) will investigate moving AntidoteDB close to the edge to provide DDN services 103
build a database requiring reduced synchronization (SyncFree FP7) with Basho, Rovio, and Trifork • Research ahead LightKone (H2020) will investigate moving AntidoteDB close to the edge to provide DDN services • Industrialization Obtaining seed funding to start a company to industrialize AntidoteDB 103