dynamo five years later
play

Dynamo, Five Years Later Andy Gross Chief Architect, Basho - PowerPoint PPT Presentation

Dynamo, Five Years Later Andy Gross Chief Architect, Basho Technologies QCon London 2013 Friday, March 8, 13 Dynamo Published October 2007 @ SOSP Describes a collection of distributed systems techniques applied to low-latency key-value


  1. Dynamo, Five Years Later Andy Gross Chief Architect, Basho Technologies QCon London 2013 Friday, March 8, 13

  2. Dynamo Published October 2007 @ SOSP Describes a collection of distributed systems techniques applied to low-latency key-value storage Spawned (along with BigTable) many imitators, an industry (LinkedIn -> Voldemort, Facebook -> Cassandra) Authors nearly got fired from Amazon for publishing Friday, March 8, 13

  3. Riak - A Dynamo Clone First lines of first prototype written in Fall 2007 on a plane on the way to my Basho interview “Technical Debt” is another term we use at Basho for this code Mostly Erlang with some C/C++ Apache2 Licensed First release in 2009, 1.3 released 2/21/13 Friday, March 8, 13

  4. Basho Friday, March 8, 13

  5. Basho Founded late 2007 by ex-Akamai people Currently ~120 employees, distributed, with offices in Cambridge, San Francisco, London, and Tokyo We sponsor of Riak Open Source We sell Riak Enterprise (Riak + Multi-DC replication) We sell Riak CS (S3 clone backed by Riak Enterprise) Friday, March 8, 13

  6. Principles Always-writable Incrementally scalable Symmetrical Decentralized Heterogenous Focus on SLAs, tail latency Friday, March 8, 13

  7. Techniques Consistent Hashing Vector Clocks Read Repair Anti-Entropy Hinted Handoff Gossip Protocol Friday, March 8, 13

  8. Consistent Hashing Invented by Danny Lewin and others @ MIT/Akamai Minimizes remapping of keys when number of hash slots changes Originally applied to CDNs, used in Dynamo for replica placement Enables incremental scalability, even spread Minimizes hot spots Friday, March 8, 13

  9. Friday, March 8, 13

  10. Vector Clocks Introduced by Mattern et al, in 1988 Extends Lamport’s timestamps (1978) Each value in Dynamo tagged with vector clock Allows detection of stale values, logical siblings Friday, March 8, 13

  11. Read Repair Update stale versions opportunistically on reads (instead of writes) Pushes system toward consistency, after returning value to client Reflects focus on a cheap, always-available write path Friday, March 8, 13

  12. Hinted Handoff Any node can accept writes for other nodes if they’re down All messages include a destination Data accepted by node other than destination is handed off when node recovers As long as a single node is alive the cluster can accept a write Friday, March 8, 13

  13. Anti-Entropy Replicas maintain a Merkle Tree of keys and their versions/hashes Trees periodically exchanged with peer vnodes Merkle tree enables cheap comparison Only values with different hashes are exchanged Pushes system toward consistency Friday, March 8, 13

  14. Gossip Protocol Decentralized approach to managing global state Trades off atomicity of state changes for a decentralized approach Volume of gossip can overwhelm networks without care Friday, March 8, 13

  15. Hinted Handoff Friday, March 8, 13

  16. Hinted Handoff X • Node fails X X X X X X X Friday, March 8, 13

  17. Hinted Handoff X • Node fails X X • Requests go to fallback X X X X X hash(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Friday, March 8, 13

  18. Hinted Handoff • Node fails • Requests go to fallback • Node comes back hash(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Friday, March 8, 13

  19. Hinted Handoff • Node fails • Requests go to fallback • Node comes back • “Handoff” - data returns to recovered node hash(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Friday, March 8, 13

  20. Hinted Handoff • Node fails • Requests go to fallback • Node comes back • “Handoff” - data returns to recovered node • Normal operations resume hash(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Friday, March 8, 13

  21. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) Friday, March 8, 13

  22. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Friday, March 8, 13

  23. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Get Handler (FSM) Friday, March 8, 13

  24. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak hash(“blocks/ 6307C89A-710A-42CD-9FFB-2A6B39F983EA”) Get Handler (FSM) == 10, 11, 12 Friday, March 8, 13

  25. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak hash(“blocks/ 6307C89A-710A-42CD-9FFB-2A6B39F983EA”) Get Handler (FSM) == 10, 11, 12 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 The Ring Friday, March 8, 13

  26. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Get Handler (FSM) get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 The Ring Friday, March 8, 13

  27. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Get Handler (FSM) R=2 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 The Ring Friday, March 8, 13

  28. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Get Handler (FSM) v1 R=2 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 The Ring Friday, March 8, 13

  29. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Get Handler (FSM) v1 v2 R=2 Friday, March 8, 13

  30. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client v2 Riak Get Handler (FSM) v2 R=2 Friday, March 8, 13

  31. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) v2 Friday, March 8, 13

  32. Read Repair get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) client v2 Riak Get Handler (FSM) v1 v2 R=2 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 v1 v2 Friday, March 8, 13

  33. Read Repair get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) client v2 Riak Get Handler (FSM) v2 R=2 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 v1 v2 Friday, March 8, 13

  34. Read Repair get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) client v2 Riak Get Handler (FSM) v2 R=2 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 v1 v1 v2 Friday, March 8, 13

  35. Read Repair get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) client v2 Riak Get Handler (FSM) v2 R=2 Coordinating node Cluster v2 v2 6 7 8 9 10 11 12 13 14 15 16 v2 v2 v2 Friday, March 8, 13

  36. Riak Architecture Erlang/OTP Runtime Friday, March 8, 13

  37. Riak Architecture Erlang/OTP Runtime Riak KV Friday, March 8, 13

  38. Riak Architecture Erlang/OTP Runtime Client APIs Riak KV Friday, March 8, 13

  39. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Riak KV Friday, March 8, 13

  40. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Riak KV Friday, March 8, 13

  41. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Riak KV Friday, March 8, 13

  42. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination Riak KV Friday, March 8, 13

  43. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce Riak KV Friday, March 8, 13

  44. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce Riak Core Riak KV Friday, March 8, 13

  45. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing Riak Core Riak KV Friday, March 8, 13

  46. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing Riak Core membership Riak KV Friday, March 8, 13

  47. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing handoff Riak Core membership Riak KV Friday, March 8, 13

  48. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing handoff Riak Core membership node-liveness Riak KV Friday, March 8, 13

  49. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing handoff gossip Riak Core membership node-liveness Riak KV Friday, March 8, 13

  50. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce consistent hashing handoff gossip Riak Core membership node-liveness buckets Riak KV Friday, March 8, 13

Recommend


More recommend