Replication and Data Consistency Flashcards
What is the read/write coherence?
A READ of a variable must always be the value of the last WRITE of the same variable.
What is transparency in replication and consistency?
Users should only think one copy of a file exists.
It should look like one system.
What is used to achieve consistency?
Consistency models
What is a consistency model?
Contract between processes and data stores.
If processes obey certain rules, data store will work correctly.
What is a strong Consistency Model?
Model that requires global ordering of updates.
When updates are commited, replicates need to reach agreement on global ordering.
Different models depending on guarentees of total ordering.
What is a weak Consistency Model?
Model that doesn’t require global ordering, more relaxed guarentees on consistency.
What is passive/active replication?
Passive: Client communicate with single replica, the primary, and one or more replicas act as backup.
Active: Client communicates with a group of k replicas.
What is the passive replication process? (4)
Client sends request to primary.
If primary is active it responds, otherwise Leader Election chooses new primary.
Any changes that the clients makes to the primary is shared with the backups.
Once all backups are updated, the primary responds to the client.
What is the active replication process? (3)
Client uses local copy of data.
Any changes made are propagated across the replicas using TO multicast.
Depending on Consistency Model, a read request may be forwarded to other servers before the response is generated.
What is strict consistency?
Requires all processes to receive responses consistent with the real value, regardless of the number of replicas.
What is linearisability?
Traces are interleaved to form a single total order (respecting local ordering)
What are the 2 conditions of linearisability?
Consistent
If t1 and t2 belong to Pi, and t1 < t2, then t1 < t2 in the combined order.
What is sequential consistency?
Read returns local copy immediately.
Write trigger TO Multicast.
Local copies on severs updated.
All replicas see the writes in the same order.
What is eventual consistency?
All replicas will eventually be consistent.
Good when inconsistency can be tolerated.
What guarentee is required for eventual consistency?
All updates are guarenteed to reach all replicas.
Update locally, and propagate in the background
How does eventual consistency deal with conflict?
Delegate to application.
Roll back to previous version.
Uss consensus to determine most recent value
What are the advantages and disadvantages of eventual consistency?
Advantages: R/W fast (consensus moved to background).
Can make progress even with network partition.
Disadvantages: Weak consistency
Still need to use consensus for conflicts.
What is a quorum?
A partial set of replicas intended to improve availability.
What are the 2 required quorums in Quorum-based protocols?
A READ quorum, and a WRITE quorum.
What is the requirement on the READ and WRITE quorums in a QBP?
They must be intersecting.
What is the goal of QBPs?
For correctness, it is sufficient to read from a READ quorum and write to a WRITE quorum.
How can a file be read in a QBP?
The client needs to assemble a READ quorum of R server replicas.
How can a file be written in a QBP?
The client needs to assemble a WRITE quorum of W server replicas.
What are R and W?
R = minimum number of nodes that must participate in a read operation. W = minimum number of nodes that must participate in a write operation.
What are the ffg constraints of R and W?
R + W > N (prevents read/write conflicts)
W > N/2 (prevents write/write conflicts)
How can we introduce bias of availability?
By variying R and W.
What is the extreme availability scheme?
W = N, R = 1 (used when writes are very infrequent)