scalable consistency for replicated data
play

Scalable consistency for replicated data Anne3e Bieniusa - PowerPoint PPT Presentation

Scalable consistency for replicated data Anne3e Bieniusa Overview Replica:on Scalable consistency Limita:ons and Outlook Anne3e Bieniusa - Scalable


  1. Scalable ¡consistency ¡for ¡ replicated ¡data ¡ Anne3e ¡Bieniusa ¡

  2. Overview ¡ ¡ Replica:on ¡ ¡ Scalable ¡consistency ¡ ¡ Limita:ons ¡and ¡Outlook ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 2 ¡

  3. Interac:ve ¡cloud-­‑backed ¡applica:ons ¡ • Large ¡ amounts ¡of ¡shared ¡mutable ¡data ¡ • High ¡availability ¡ expecta:ons ¡ • Low ¡latency ¡ business ¡cri:cal ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 3 ¡

  4. Server-­‑client ¡abstrac:on ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 4 ¡

  5. But ¡in ¡reality ¡... ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 5 ¡

  6. Replica:on! ¡ How ¡to ¡keep ¡the ¡replicas ¡consistent?! ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 6 ¡

  7. Strongly-­‑consistent ¡replica:on ¡ 1. Update(x,4) ¡ 2. Update(x,6) ¡ 3. .... ¡ Update(x, ¡4) ¡ Update(x,6) ¡ • Requires ¡strong ¡synchroniza:on ¡ • High ¡update ¡latency ¡ • Not ¡scalable ¡ • No ¡par::on-­‑tolerance ¡ ¡ ¡ ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 7 ¡

  8. Asynchronous ¡update-­‑propaga:on ¡ ? ¡ ? ¡ x ¡= ¡4 ¡ x ¡= ¡6 ¡ Read(x) ¡ Update(x, ¡4) ¡ Update(x,6) ¡ • Op:mis:c ¡ • Low ¡update ¡latency ¡ • High ¡availability ¡ • ... ¡at ¡the ¡expense ¡of ¡weaker ¡consistency ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 8 ¡

  9. Consistency.TradeCoffs Performance Consistency Availability Strong.Consistency See.all.previous.writes. � . � . � . � Bounded.Staleness See.all.“old”.writes. � . � . � . � � � . Monotonic.Reads See.increasing.subset.of.writes. � . � . � . � . � . � � . � . Read.My.Writes See.all.writes.performed.by.reader. � . � � . � � . � Consistent.Prefix See.iniNal.sequence.of.writes. � . � . � . � . � . � � . � . � Eventual.Consistency See.subset.of.previous.writes. � . � . � . � . � . � � . � Adapted.from.Doug.Terry:.Cloud.Storage.Consistency.Explained.Through.Baseball..Dagstuhl.2013C02 9 ¡

  10. Limita:ons ¡ • Fisher, ¡Lynch, ¡Pa3erson ¡(’85) ¡ Consensus ¡ ∩ ¡Determinis:c ¡ ∩ ¡Asynchronous ¡ ∩ ¡Faults ¡= ¡ ∅ ¡ ¡ • Brewer ¡(’00); ¡Gilbert ¡& ¡Lynch ¡(’06) ¡ Strongly-­‑consistent ¡ ∩ ! Available ¡ ∩ ¡Par::on-­‑tolerant != ! ∅ ¡ ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 10 ¡

  11. Eventual ¡Consistency ¡ • Availability ¡and ¡performance ¡ • Crash-­‑recovery ¡fault-­‑model ¡ • Update ¡each ¡replica ¡independently ¡ – Transport ¡to ¡other ¡replicas ¡and ¡apply ¡ • Guaranteed ¡delivery: ¡ eventually , ¡all ¡replicas ¡ receive ¡all ¡updates ¡ – But: ¡Order ¡of ¡updates ¡may ¡differ! ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 11 ¡

  12. Example: ¡Replicated ¡Integer ¡ set(x,1) ¡ x ¡= ¡0 ¡ x ¡= ¡1 ¡ ??? ¡ x ¡= ¡0 ¡ ??? ¡ ??? ¡ x ¡= ¡0 ¡ x ¡= ¡3 ¡ set(x,3) ¡ • Decentralized ¡conflict ¡resolu:on ¡ – ¡“conflict-­‑free ¡by ¡design” ¡ – No ¡user ¡interac:on ¡required ¡ • How ¡are ¡updates ¡propagated? ¡ • Generic ¡policy ¡vs. ¡data ¡type ¡specific ¡ – Seman:cs ¡of ¡concurrent ¡updates ¡based ¡on ¡abstract ¡data ¡type ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 12 ¡

  13. Highest ¡:mestamp ¡wins ¡(LWW) ¡ set(x,1); ¡t=45 ¡ (x,3); ¡t=12 ¡ x ¡= ¡1 ¡ [45] ¡ x ¡= ¡0 ¡ x ¡= ¡1[45] ¡ (x,3); ¡t=12 ¡ (x,1); ¡t=45 ¡ x ¡= ¡0 ¡ x ¡= ¡3[12] ¡ x ¡= ¡1[45] ¡ x ¡= ¡0 ¡ x ¡= ¡3[12] ¡ set(x,3); ¡t=12 ¡ • Generic ¡policy: ¡Symmetry ¡breaking ¡ • Requires ¡total ¡order ¡on ¡updates ¡ • Transmit ¡data ¡+ ¡:mestamp ¡(unique, ¡monotonically ¡growing) ¡ • E.g. ¡global ¡clock ¡server, ¡synchronized ¡physical ¡clocks ¡ • Widely ¡used: ¡file ¡systems, ¡key-­‑value ¡stores ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡

  14. Mul:-­‑value ¡registers ¡(MVR) ¡ set(x,1) ¡ set(x,1) ¡ set(x,3) ¡ x ¡= ¡1 ¡ x ¡= ¡0 ¡ x ¡= ¡{1,3} ¡ x ¡= ¡1 ¡ set(x,3) ¡ set(x,1) ¡ x ¡= ¡0 ¡ x ¡= ¡3 ¡ x ¡= ¡{1,3} ¡ x ¡= ¡0 ¡ x ¡= ¡3 ¡ set(x,3) ¡ • Generic ¡policy ¡ • No ¡automa:c ¡conflict ¡resolu:on, ¡requires ¡user ¡interac:on ¡ • Widely ¡used ¡in ¡version ¡control ¡systems, ¡workflow ¡systems ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡

  15. Op-­‑based ¡counter ¡ incrBy(x,1) ¡ incrBy(x,3) ¡ x ¡= ¡1 ¡ x ¡= ¡0 ¡ x ¡= ¡4 ¡ incrBy(x,3) ¡ incrBy(x,1) ¡ x ¡= ¡0 ¡ x ¡= ¡3 ¡ x ¡= ¡4 ¡ x ¡= ¡0 ¡ x ¡= ¡3 ¡ incrBy(x,3) ¡ Data-­‑type ¡specific: ¡Integer ¡ ¡-­‑> ¡Counter ¡ ¡ • ADT ¡with ¡interface: ¡incrBy, ¡decrBy ¡ • Send ¡opera:on ¡+ ¡params ¡to ¡other ¡replicas ¡ • Re-­‑execute ¡opera:on ¡ Depending ¡on ¡communica:on ¡layer ¡ • – Idempotence ¡ – Commuta:vity ¡ – Meta-­‑data ¡to ¡track ¡causality ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡

  16. update: ¡post ¡ update: ¡post ¡ update: ¡post ¡ u:post ¡ read ¡ Jen ¡skips ¡the ¡party ¡ Let ¡me ¡call ¡her ¡ She’s ¡coming! ¡ Yay! ¡ update: ¡post ¡ update: ¡post ¡ update: ¡post ¡ read ¡ Jen ¡skips ¡the ¡party ¡ Let ¡me ¡call ¡her ¡ She’s ¡coming! ¡ update: ¡post ¡ update: ¡post ¡ update: ¡post ¡ !?! ¡ u:post ¡ read ¡ Jen ¡skips ¡the ¡party ¡ Let ¡me ¡call ¡her ¡ She’s ¡coming! ¡ Great! ¡ u:post ¡ update: ¡post ¡ read ¡ Great! ¡ Jen ¡skips ¡the ¡party ¡ u:post ¡ read ¡ Yay! ¡ update: ¡post ¡ update: ¡post ¡ update: ¡post ¡ u:post ¡ read ¡ read ¡ read ¡ Jen ¡skips ¡the ¡party ¡ Let ¡me ¡call ¡her ¡ She’s ¡coming! ¡ Great! ¡ 16 ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡

  17. Causal ¡Consistency ¡ client ¡invoca:on ¡order ¡ reads-­‑from ¡order ¡ + ¡ transi:ve ¡closure ¡ + ¡ • User-­‑friendly ¡ • Subsumes ¡session ¡guarantees ¡read-­‑my-­‑writes, ¡monotonic ¡reads, ¡ etc. ¡ • Strongest ¡always-­‑available ¡consistency ¡ • Implementa:on: ¡ ¡VC, ¡graph. ¡ ¡Scale? ¡ u:post ¡ read ¡ Yay! ¡ update: ¡post ¡ update: ¡post ¡ update: ¡post ¡ u:post ¡ read ¡ read ¡ read ¡ Jen ¡skips ¡the ¡party ¡ Let ¡me ¡call ¡her ¡ She’s ¡coming! ¡ Great! ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 17 ¡

  18. Vector ¡clocks ¡ [1,0,0] ¡ [1,2,1] ¡ [0,0,0] ¡ [1,2,0] ¡ [1,1,0] ¡ [0,0,0] ¡ [0,0,0] ¡ [1,2,1] ¡ [0,0,1] ¡ • V i [j] ¡= ¡#events ¡of ¡j ¡observed ¡by ¡i ¡ • V i [j] ¡– ¡V i’ [j] ¡= ¡events ¡of ¡j ¡that ¡i’ ¡should ¡transmit ¡to ¡i ¡ • V(a) ¡< ¡V(b) ¡ = ¡a ¡happened ¡before ¡b ¡ • V(a) ¡< ¡V(b) ¡ ∧ ¡V(b) ¡< ¡V(a) ¡ = ¡a ¡concurrent ¡with ¡b ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡ 18 ¡

  19. State-­‑based ¡counter ¡ [0,0,0] ¡ [1,0,0] ¡ [1,0,1] ¡ incrBy(x,1) ¡ incrBy(x,3) ¡ [1,0,0] ¡ [1,0,3] ¡ [0,0,0] ¡ [0,0,0] ¡ [0,0,1] ¡ [1,0,1] ¡ incrBy(x,3) ¡ incrBy(x,1) ¡ [0,0,0] ¡ [0,0,3] ¡ [1,0,3] ¡ [0,0,0] ¡ [0,0,1] ¡ ¡ [0,0,0] ¡ [0,0,3] ¡ ¡ incrBy(x,3) ¡ • Send ¡payload ¡(state, ¡VC) ¡+ ¡merge ¡ • Don't ¡go ¡backwards ¡ ⟹ ¡par:al ¡order ¡ • Apply ¡each ¡update ¡once ¡ ⟹ ¡idempotent ¡ • Merge ¡in ¡any ¡order ¡ ⟹ ¡commuta:ve ¡ • Merge ¡contains ¡several ¡updates ¡ ⟹ ¡associa:ve ¡ Anne3e ¡Bieniusa ¡-­‑ ¡Scalable ¡Consistency ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend