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 GOTO Chicago 2013 Tuesday, April 23, 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 GOTO Chicago 2013 Tuesday, April 23, 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 Tuesday, April 23, 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 Tuesday, April 23, 13

  4. 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 just open sourced Riak CS (S3 clone backed by Riak Enterprise) Tuesday, April 23, 13

  5. Principles Always-writable Incrementally scalable Symmetrical Decentralized Heterogenous Focus on SLAs, tail latency Tuesday, April 23, 13

  6. Techniques Consistent Hashing Vector Clocks Read Repair Anti-Entropy Hinted Handoff Gossip Protocol Tuesday, April 23, 13

  7. 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 Tuesday, April 23, 13

  8. Tuesday, April 23, 13

  9. 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 Tuesday, April 23, 13

  10. 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 Tuesday, April 23, 13

  11. 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 Tuesday, April 23, 13

  12. 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 Tuesday, April 23, 13

  13. 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 Tuesday, April 23, 13

  14. Hinted Handoff Tuesday, April 23, 13

  15. Hinted Handoff X • Node fails X X X X X X X Tuesday, April 23, 13

  16. Hinted Handoff X • Node fails X X • Requests go to fallback X X X X X hash(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA ”) Tuesday, April 23, 13

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

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

  19. 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 ”) Tuesday, April 23, 13

  20. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) Tuesday, April 23, 13

  21. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) client Riak Tuesday, April 23, 13

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

  23. 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 Tuesday, April 23, 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 Coordinating node Cluster 6 7 8 9 10 11 12 13 14 15 16 The Ring Tuesday, April 23, 13

  25. 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 Tuesday, April 23, 13

  26. 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 Tuesday, April 23, 13

  27. 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 Tuesday, April 23, 13

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

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

  30. Anatomy of a Request get(“ blocks/6307C89A-710A-42CD-9FFB-2A6B39F983EA” ) v2 Tuesday, April 23, 13

  31. 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 Tuesday, April 23, 13

  32. 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 Tuesday, April 23, 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 v1 v2 Tuesday, April 23, 13

  34. 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 Tuesday, April 23, 13

  35. Riak Architecture Erlang/OTP Runtime Tuesday, April 23, 13

  36. Riak Architecture Erlang/OTP Runtime Riak KV Tuesday, April 23, 13

  37. Riak Architecture Erlang/OTP Runtime Client APIs Riak KV Tuesday, April 23, 13

  38. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Riak KV Tuesday, April 23, 13

  39. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Riak KV Tuesday, April 23, 13

  40. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Riak KV Tuesday, April 23, 13

  41. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination Riak KV Tuesday, April 23, 13

  42. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce Riak KV Tuesday, April 23, 13

  43. Riak Architecture Erlang/OTP Runtime Client APIs HTTP Protocol Buffers Erlang local client Request Coordination get put delete map-reduce Riak Core Riak KV Tuesday, April 23, 13

  44. 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 Tuesday, April 23, 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 membership Riak KV Tuesday, April 23, 13

  46. 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 Tuesday, April 23, 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 node-liveness Riak KV Tuesday, April 23, 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 gossip Riak Core membership node-liveness Riak KV Tuesday, April 23, 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 buckets Riak KV Tuesday, April 23, 13

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