Consistency Models Flashcards
What do Strong Consistency Models do?
-Prioritize consistency over availability.
-Require global ordering of updates.
-All replicas must agree on the order of updates.
What do Weak Consistency Models do?
-Prioritize availability over consistency.
-No global ordering of updates.
-Different replicas may have different views of data, but aim for eventual consistency.
What is the differences between Passive And Active Replication?
Passive replication allows for one replica to serve as the Primary, while others are Backups or Secondaries, clients interact solely with the primary, and if it fails a Backup takes over with Leader Election.
Active Replication clients communicate with a group of services called replicas and updates are propagated among replicas using total-order multicast.W
What is Strict Consistency?
A write to any variable by any replica is immediately available to all other replicas.
To a client the system behaves as a single store.
Impossible to achieve in distributed system as requires instantaneous message exchange.
What is Linearizability?
-Read and writes are executed as if they are in a single linear order, despite being distributed across multiple processes.
-If an operation op1 completes before op2 begins, then op1 precedes op2, in the trace.
How is linearizability implemented?
-Every process must have a perfectly synchronized clock.
-Message propagation delays must be bounded.
-Use total ordering multicast to ensure replicas handle reads and writes in the same order.
What is sequential consistency? (see example p.15))
-Preserves the order of writes that happen on a replica.
-The execution order between processes is undefined.
-If a write W(X)b precedes another W(x) a in a trace , then no process reading x will read R(x) a before R(x)b.
How is Sequential Consistency implemented?
-A read operation made to a replica will return its local copy.
-A write operation will trigger a Total-Order multicast.
-Replicas respond to multicast by updating their local copy and return an acknowledgment.
-All replicas write operations in the same order and read operations return values consistently with the sequence in total-order.
What is Casual Consistency? (see example p.18)
-Ensures all writes that have a casual relationship are seen by all process in the same order.
-Unrelated writes can be seen in any order.
-Order of values returned by read operations must be consistent with casual order.
How is Casual Consistency implemented?
-Use vector timestamps.
-Write operations are multicasted to all replicas.
-On receiving multicast updates , each replica updates its local copy.
-A read uses the local copy.
-No need for synchronised physical clocks.
What is Eventual Consistency?
-Updates can be propagated independently across distributed replicas.
-Replicas may temporarily have differing states due to the asynchronous updates.
-Given sufficient time without further updates, all replicas will eventually converge to the same state.
-It makes no guarantees for how long it might take , just that it will eventually happen.
-An application must be able to tolerate replicas being in an inconsistent state.
-Conflicts can occur so the application needs a way to resolve the conflicting state.
How is Eventual Consistency Implemented?
-Update local store and propagate changes in the background.
-To deal with conflict: either reconcile conflict or roll back or delegate the application.
What is Strong Eventual Consistency?
-Addresses the weaknesses of eventual consistency.
-Strong eventual consistency adds the safety guarantee that any two nodes that have received the same set of updates will be in the same state.
-Does not depend on synchronous communication.
-Updates can be applied locally and then propagated via casual multicast to other replicas.
What are the two types of Conflict-Free Replicated Data type?
Operation-based CRDTs, State-based CRDTs
What is a quorum?
A quorum is a common approach of implementing consistency across a number of replicas in a distributed datas store. It is a subset of replicas, dynamically selected during operations.