Practical ReplicationPurposes of ReplicationProblems with ReplicationThe Costs and Limits of Availability for Replicated ServicesContinuous Consistency ModelMetrics of ConsistencyExample of Numerical and Order ErrorDeriving tight upper bound on availabilityUpper bound as a function of Numerical error and stalenessUpper bound as a function of order errorSerialization orderWhat can we get from this?Numerical Error BoundOrder Error BoundEffects of Replication ScaleThe Dangers of Replication and a SolutionHow does replication models affect deadlock/reconciliation ratesEager ReplicationLazy Group ReplicationSlide 20Lazy Master ReplicationNon-Transactional SchemesTwo-tier systemSlide 24Slide 25ExampleSlide 27Two-tier systemPractical ReplicationPurposes of ReplicationImprove AvailabilityReplicated databases can be accessed even if several replicas are unavailableImprove PerformanceReplicas can be geographically diverse, with closest replica serving each clientProblems with ReplicationConsistency of the replicated dataMany applications require consistency regardless of which replica is read from or inserted intoConsistency is expensiveSome replication schemes will reduce update availabilityOthers require reconciliation after inconsistency occursPerformance may suffer as agreement across replicas may be necessaryThe Costs and Limits of Availability for Replicated ServicesConsistency vs. AvailabilityMany applications don’t need strong consistencyCan specify a maximum deviationConsistency don’t need to be sacrificed during normal operationOnly perform tradeoff when failure occursTypically two choices of consistencyStrong consistencyLow availability, high data accuracyWeak consistencyHigh availability, low accuracy (lots of conflicts and stale access)Continuous Consistency ModelA spectrum of different levels of consistencyDynamically adapt consistency bounds in response to environmental changesContinuous Consistency ModelMetrics of ConsistencyThree categories of errors in consistency at a replicaNumerical error The total number of writes accepted by the system but not seen by the replicaStalenessDifference between current time and the acceptance time of the oldest write not seen locallyOrder errorNumber of writes that have not established their commit order at the local replicaExample of Numerical and Order ErrorDeriving tight upper bound on availabilityWant to derive a tight upper bound on the Availservice based on a given level of consistency, workload, and faultloadAvailservice F(consistency, workload, faultload)Upper bound helps evaluate existing consistency protocolsReveal inherent impact of consistency on availabilityOptimize existing consistency protocolsQuestions:Must determine which write to accept or rejectAccepting all writes that do not violate consistency may preclude acceptance of a larger number of write in the futureDetermine when and where to propagate writesWrite propagation decreases numerical error but can increase order errorMust decide serialization orderCan affect the order errorUpper bound as a function of Numerical error and stalenessQuestions on write propagationWhen and where to propagate writesSimply propagate writes to all replicas whenever possible – Aggressive write propagationAlways help reduce both numerical error and stalenessQuestions on write acceptanceMust perform a exhaustive search on all possible sets of accepted writesTo maximize availability and ensure numerical and staleness bounds are not violatedSearch space can be reduced by collapsing all writes in an interval to a single logical writeDue to Aggressive write propagationUpper bound as a function of order errorTo commit a write, a replica must see all preceding writes in the global serialization orderMust determine the global serialization orderFactorial number of serialization orderSearch space can be reducedCausal orderSerialization orders compatible with causal orderCluster orderWrites accepted by the same partition during a particular interval cluster togetherSerialization orderExample:Suppose Replica 1 receives transaction W1 and W2 and Replica 2 receives W3 and W4CausalS = W1W2W3W4 better than S’ = W2W1W3W4Whenever W2 can be committed using S’, the replica must bave already seen W1 and thus can also commit W2 in S. The same is true for W1, W3, W4ClusterOnly 2 possible clustersS = W1W2W3W4 and W3W4W1W2Intuition is that it does not expedite write commitment on any replica if the writes accepted by the same partition during a particular interval are allowed to split into multiple sections in the serialization orderCluster has smallest search spaceWhat can we get from this?Modify an existing protocol with ideas from proofEach replica ensure that the error bound on other replicas are not violatedReplica may push writes to other replicas before accepting a new writeAdded aggressive write propagationAnalyze other protocols for order errorPrimary copy protocolA write is committed when it reaches the primary replicaSerialization order is the write order as seen by primary replicaGolding’s algorithmEach write assigned a logical timestamp that determines serialization orderEach replica maintains a version vector to determine whether it has seen all writes with time less than tPulls in writes from other replicas to advance version vectorVotingOrder is determining by voting of membersIs there anything else other than Aggressive Write Propagation that we can get from this proof?Numerical Error BoundAs predicted, aggressive write propagation improves availabilityAlso increases the number of messages requiredRemoves the optimization of combining multiple updates to amortize communication costsPacket header overhead, packet boundaries, ramping up to the bottleneck bandwidth in TCPOrder Error Bound Aggressive Voting also performs wellBase voting is awfulLazy replication can cause each replica to casts a vote for a different uncommitted writeEach replica must collect votes from all replicas to determine winner and any unknown vote can be the deciding oneAggressive ensures most votes for the same uncommitted writeOnly need to contact a subset of nodesEffects of Replication ScaleAdding more replicas Reduces
View Full Document