network is reliable Latency is zero (The 8 Fallacies of Distributed Computing, P. Deutsh) If your system is large and geo-distributed they are often both false Network partitions and long latencies are bound to happen (An informal survey of real-world comm. failures, P. Bailis, K. Kingsbury)
network is reliable Latency is zero (The 8 Fallacies of Distributed Computing, P. Deutsh) If your system is large and geo-distributed they are often both false Network partitions and long latencies are bound to happen (An informal survey of real-world comm. failures, P. Bailis, K. Kingsbury)
small scale entities Eventual consistency across large scale entities (AP under CAP) (Life beyond Distributed Transactions, Pat Helland) CC BY: Scott Beale / Laughing Squid
availability, now what? Updates take time to travel to remote locations (light is slow) Globally, data diverges Immediate responses from local data (reads and writes) Local entity data mutates: Immediately, by changes due to IO with local users Eventually, by remote changes that trickle in from net IO Consistency recovered if seeing same set of mutations (EC)
availability, now what? Updates take time to travel to remote locations (light is slow) Globally, data diverges Immediate responses from local data (reads and writes) Local entity data mutates: Immediately, by changes due to IO with local users Eventually, by remote changes that trickle in from net IO Consistency recovered if seeing same set of mutations (EC)
availability, now what? Updates take time to travel to remote locations (light is slow) Globally, data diverges Immediate responses from local data (reads and writes) Local entity data mutates: Immediately, by changes due to IO with local users Eventually, by remote changes that trickle in from net IO Consistency recovered if seeing same set of mutations (EC)
a sequential entity User Log Vision Lamb Dog Wolf Lamb Dog Wolf Lamb Dog Wolf Lamb Lamb Lamb Dog Dog Dog Wolf Wolf Wolf Invariant: No wolf with lamb without shepherd dog.
a sequential entity User Log Vision Lamb Dog Wolf Lamb Dog Wolf Lamb Dog Wolf Lamb Lamb Lamb Dog Dog Dog Wolf Wolf Wolf Invariant: No wolf with lamb without shepherd dog.
a sequential entity Lamb User Log Vision Lamb Dog Wolf Lamb Dog Wolf Lamb Dog Wolf Lamb Lamb Lamb Dog Dog Dog Wolf Wolf Wolf Invariant: No wolf with lamb without shepherd dog.
Some amount of ordering brings some consistency Helps preserving some invariant types Question is: Which ordering guarantees still preserve availability?
Some amount of ordering brings some consistency Helps preserving some invariant types Question is: Which ordering guarantees still preserve availability?
fact: No consistency semantics stronger than real time causal consistency can be implemented using a one-way convergent and always available distributed storage implementation. (Consistency, Availability, and Convergence. P. Mahajan, L. Alvisi, M. Dahlin) CC BY: Julie Falk
are concurrent or causally related → Operations from the same replica are always related Operations from different replicas can be related or concurrent Consider operations add(wolf) and rmv(wolf) If add(wolf) → rmv(wolf), necessarily wolf ∈ S If add(wolf) rmv(wolf), there are options: Add-wins: wolf ∈ S Remove-wins: wolf ∈ S Predictability For related operations, sequential semantics is preserved. Deterministic decision for concurrent operations.
are concurrent or causally related → Operations from the same replica are always related Operations from different replicas can be related or concurrent Consider operations add(wolf) and rmv(wolf) If add(wolf) → rmv(wolf), necessarily wolf ∈ S If add(wolf) rmv(wolf), there are options: Add-wins: wolf ∈ S Remove-wins: wolf ∈ S Predictability For related operations, sequential semantics is preserved. Deterministic decision for concurrent operations.
are concurrent or causally related → Operations from the same replica are always related Operations from different replicas can be related or concurrent Consider operations add(wolf) and rmv(wolf) If add(wolf) → rmv(wolf), necessarily wolf ∈ S If add(wolf) rmv(wolf), there are options: Add-wins: wolf ∈ S Remove-wins: wolf ∈ S Predictability For related operations, sequential semantics is preserved. Deterministic decision for concurrent operations.
are concurrent or causally related → Operations from the same replica are always related Operations from different replicas can be related or concurrent Consider operations add(wolf) and rmv(wolf) If add(wolf) → rmv(wolf), necessarily wolf ∈ S If add(wolf) rmv(wolf), there are options: Add-wins: wolf ∈ S Remove-wins: wolf ∈ S Predictability For related operations, sequential semantics is preserved. Deterministic decision for concurrent operations.
datatypes. Datatypes provide semantic context on the operations Conflict-free Replicated Datatypes (CRDTs) Registers, Sets, Maps, Timelines . . . Always available, causal consistency Converge deterministically Two flavours Operation-based. Operations are sent to all other replicas State-based. State is changed, gossiped and merged
datatypes. Datatypes provide semantic context on the operations Conflict-free Replicated Datatypes (CRDTs) Registers, Sets, Maps, Timelines . . . Always available, causal consistency Converge deterministically Two flavours Operation-based. Operations are sent to all other replicas State-based. State is changed, gossiped and merged
datatypes. Datatypes provide semantic context on the operations Conflict-free Replicated Datatypes (CRDTs) Registers, Sets, Maps, Timelines . . . Always available, causal consistency Converge deterministically Two flavours Operation-based. Operations are sent to all other replicas State-based. State is changed, gossiped and merged
commutative downstream message Reliable causal broadcast disseminates message Delivered messages transform the remote state Queries operate on the state (Conflict-Free Replicated Data Types. Shapiro, Pregui¸ ca, Baquero, Zarwiski )
gossiped to one or more replicas Received state merged to local state Queries operate on the state No tight control on participating replicas. Elasticity. (Conflict-Free Replicated Data Types. Shapiro, Pregui¸ ca, Baquero, Zarwiski )
delta Delta merged into local state and local buffer Local buffer gossiped to one or more replicas and reseted Received state merged to local state and buffer Queries operate on the state State can grow with small impact on the dissemination (Efficient State-based CRDTs by Delta-Mutation. Almeida, Shoker, Baquero)
be preserved Design options only over concurrently executed operations Pure operation-based can allow very compact states. Deltas make big state more acceptable Inherent tradeoff among operation and state based
be preserved Design options only over concurrently executed operations Pure operation-based can allow very compact states. Deltas make big state more acceptable Inherent tradeoff among operation and state based
be preserved Design options only over concurrently executed operations Pure operation-based can allow very compact states. Deltas make big state more acceptable Inherent tradeoff among operation and state based
be preserved Design options only over concurrently executed operations Pure operation-based can allow very compact states. Deltas make big state more acceptable Inherent tradeoff among operation and state based