SlideShare una empresa de Scribd logo
1 de 74
Dynomite
Yet Another Distributed Key Value Store
@moonpolysoft -
  questions
A Crowded Field
• Cassandra
• Lightcloud
• Memcachedb
• Redis
• Tokyo Tyrannical Cabinet Device Thing
• Voldemort
Who here has written
       one?
Alpha - 0.6.0
Focus on Distribution
Focus on Performance
• Latency
 • Average ~ 10 ms
 • Median ~ 5 ms
 • 99.9% ~ 1 s
• Throughput
 • R12B ~ 2,000 req/s
 • R13B ~ 6,500 req/s
At Powerset

• 12 machine production cluster
• ~6 million images + metadata
• ~2 TB of data including replicas
• ~139KB average size
Production?

• Data you can afford to lose
• Compatibility will break
• Migration will be provided
The Constants
Consistency
Throughput
                        Durability




         N – Replication
Max Replicas per
   Partition
Latency           Consistency




     R – Read Quorum
Minimum participation
      for read
Latency          Durability




    W – Write Quorum
Minimum participation
      for write
Throughput              Scalability




         Q – Partitioning
Partitions =   2Q
QNRW – Defines your
     cluster
At Powerset

• Batch writes
• Online reads
• Wikipedia pages are obese
Q – 6
N–3
R–1
W–2
(dynomite@galva)2> mediator:put(
 quot;prefs:user:mervquot;,
 undefined,
 term_to_binary(
   [{safe_search, false}, {results, 50}])).
(dynomite@galva)2> mediator:put(
 quot;prefs:user:mervquot;,
 undefined,
 term_to_binary(
   [{safe_search, false}, {results, 50}])).
(dynomite@galva)2> mediator:put(
 quot;prefs:user:mervquot;,
 undefined,
 term_to_binary(
   [{safe_search, false}, {results, 50}])).
(dynomite@galva)2> mediator:put(
 quot;prefs:user:mervquot;,
 undefined,
 term_to_binary(
   [{safe_search, false}, {results, 50}])).
Value is always Binary
(dynomite@galva)2> mediator:put(
 quot;prefs:user:mervquot;,
 undefined,
 term_to_binary(
   [{safe_search, false}, {results, 50}])).
(dynomite@galva)1> {ok, {Context, [Bin]}} =
mediator:get(quot;prefs:user:mervquot;).

{ok,{[{quot;<0.630.0>quot;,1240543271.698089}],
     [<<131,108,0,0,0,2,...>>]}}

(dynomite@galva)2> Terms = binary_to_term(Bin).

[{safe_search,false},{results,50}]
(dynomite@galva)1> {ok, {Context, [Bin]}} =
mediator:get(quot;prefs:user:mervquot;).

{ok,{[{quot;<0.630.0>quot;,1240543271.698089}],
     [<<131,108,0,0,0,2,...>>]}}

(dynomite@galva)2> Terms = binary_to_term(Bin).

[{safe_search,false},{results,50}]
mediator:delete/1
mediator:has_key/1
Up In Dem Gutz
Client Protocols

• Native Erlang Messages
• Thrift
• Protocol Buffers
• Ascii Protocol
Mediator
N – 3 ;R – 2
pmap(Fun, List, ReturnNum) ->
 N = if
   ReturnNum > length(List) -> length(List);
   true -> ReturnNum
 end,
 SuperParent = self(),
 SuperRef = erlang:make_ref(),
 Ref = erlang:make_ref(),
 %% we spawn an intermediary to collect the results
 %% this is so that there will be no leaked messages sitting in our mailbox
 Parent = spawn(fun() ->
     L = gather(N, length(List), Ref, []),
     SuperParent ! {SuperRef, pmap_sort(List, L)}
   end),
 Pids = [spawn(fun() ->
     Parent ! {Ref, {Elem, (catch Fun(Elem))}}
   end) || Elem <- List],
 Ret = receive
   {SuperRef, Ret} -> Ret
 end,
 % i think we need to cleanup here.
 lists:foreach(fun(P) -> exit(P, die) end, Pids),
Membership
Handles Nodes Joining
membership:nodes() =/= nodes().
• Receive join notification
• Recalculate partition to node mapping
• Start bootstrap routines
• Stops old local storage servers
• Starts new local storage servers
• Install the new partition table
Maps Partitions To Nodes
Gossip Girl
• Gossip servers randomly wake up
• Pick another membership server
• Merge membership tables
• Versioned by vector clocks
gossip_loop(Server) ->
 #membership{nodes=Nodes,node=Node} = gen_server:call(Server, state),
 case lists:delete(Node, Nodes) of
  [] -> ok; % no other nodes
  Nodes1 when is_list(Nodes1) ->
    fire_gossip(random_node(Nodes1))
 end,
 SleepTime = random:uniform(5000) + 5000,
 receive
  stop -> gossip_paused(Server);
  _Val -> ok
 after SleepTime ->
  ok
 end,
 gossip_loop(Server).
Storage Server
Merkle Trees
Merkle Trees
O(log n)
• Implemented on disk as a B-Tree
• Includes buddy-block allocator for key
  space

• Extremely gnarly code
Minimal Transfer
Sync Server
Randomly Wakes Up
Choses two replicas
Transfers Merkle Diff
[cli@yourmom ~]$ dynomite console

(dynomite@yourmom)1 sync_manager:running().

[{3623878657,'dynomite@yourmom','dynomite@yourd
ad'},

{3892314113,'dynomite@yourmom','dynomite@cableg
uy'},
Problem Areas
Membership
Problems

• New partitions online before they are
  ready
• A priori knowledge of what is running
• Possible to dilute a cluster into uselessness
• Migrations are tremendously painful
Direction

• Storage servers rally with local membership
  server
• Use monitors on local storage
• Alerts for dangerous situations
Merkle
Erlang is good at many
         things
Low level storage ain’t
         one
Direction

• Rewrite Dmerkle storage in C
• Use async driver pool
• Build in more crash recovery to the format
Web Console
Direction


• More detailed visualizations of cluster
  health
• Perform “safe” ops tasks
And other things I
haven’t thought of
Demo!
Spare a patch, friend?
• http://github.com/cliffmoon/dynomite
• http://wiki.github.com/cliffmoon/dynomite
Q and or A

Más contenido relacionado

La actualidad más candente

Ifr tool log
Ifr tool logIfr tool log
Ifr tool log
boxbandit
 

La actualidad más candente (20)

Reactive Microservices with JRuby and Docker
Reactive Microservices with JRuby and DockerReactive Microservices with JRuby and Docker
Reactive Microservices with JRuby and Docker
 
Nginx Scalable Stack
Nginx Scalable StackNginx Scalable Stack
Nginx Scalable Stack
 
Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
 
Writing Java Serverless Application Using Micronaut
Writing Java Serverless Application Using MicronautWriting Java Serverless Application Using Micronaut
Writing Java Serverless Application Using Micronaut
 
WordPress Performance Tuning
WordPress Performance TuningWordPress Performance Tuning
WordPress Performance Tuning
 
DPNHTW
DPNHTWDPNHTW
DPNHTW
 
Preview of Apache Pulsar 2.5.0
Preview of Apache Pulsar 2.5.0Preview of Apache Pulsar 2.5.0
Preview of Apache Pulsar 2.5.0
 
On the way to low latency (2nd edition)
On the way to low latency (2nd edition)On the way to low latency (2nd edition)
On the way to low latency (2nd edition)
 
linux networking commands short
linux networking commands shortlinux networking commands short
linux networking commands short
 
Ganglia Monitoring Tool
Ganglia Monitoring ToolGanglia Monitoring Tool
Ganglia Monitoring Tool
 
tdc2012
tdc2012tdc2012
tdc2012
 
Part 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksPart 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows Networks
 
DNS-SD Extentions
DNS-SD ExtentionsDNS-SD Extentions
DNS-SD Extentions
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing Solutions
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof Dębski
 
Pick diamonds from garbage
Pick diamonds from garbagePick diamonds from garbage
Pick diamonds from garbage
 
dns.workshop.hsgr
dns.workshop.hsgrdns.workshop.hsgr
dns.workshop.hsgr
 
Dnsdist
DnsdistDnsdist
Dnsdist
 
Ifr tool log
Ifr tool logIfr tool log
Ifr tool log
 

Destacado

Destacado (6)

Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...Databus - Abhishek Bhargava &  Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
 
Seattle kafka meetup nov 2015 published siphon
Seattle kafka meetup nov 2015 published  siphonSeattle kafka meetup nov 2015 published  siphon
Seattle kafka meetup nov 2015 published siphon
 
Samza tech talk_2015 - strata
Samza tech talk_2015 - strataSamza tech talk_2015 - strata
Samza tech talk_2015 - strata
 
Database2011 MySQL Sharding
Database2011 MySQL ShardingDatabase2011 MySQL Sharding
Database2011 MySQL Sharding
 
All Aboard the Databus
All Aboard the DatabusAll Aboard the Databus
All Aboard the Databus
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture Pipeline
 

Similar a Dynomite at Erlang Factory

Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
davidblum
 
Web 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web AppsWeb 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web Apps
adunne
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Jesse Vincent
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
Odoo
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
brian d foy
 

Similar a Dynomite at Erlang Factory (20)

Dynomite Nosql
Dynomite NosqlDynomite Nosql
Dynomite Nosql
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling Twitter
 
Perl at SkyCon'12
Perl at SkyCon'12Perl at SkyCon'12
Perl at SkyCon'12
 
MySQL Proxy tutorial
MySQL Proxy tutorialMySQL Proxy tutorial
MySQL Proxy tutorial
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDB
 
All The Little Pieces
All The Little PiecesAll The Little Pieces
All The Little Pieces
 
Tips on High Performance Server Programming
Tips on High Performance Server ProgrammingTips on High Performance Server Programming
Tips on High Performance Server Programming
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
Web 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web AppsWeb 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web Apps
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
 
HBaseCon2017 gohbase: Pure Go HBase Client
HBaseCon2017 gohbase: Pure Go HBase ClientHBaseCon2017 gohbase: Pure Go HBase Client
HBaseCon2017 gohbase: Pure Go HBase Client
 
2013 london advanced-replication
2013 london advanced-replication2013 london advanced-replication
2013 london advanced-replication
 
Replication MongoDB Days 2013
Replication MongoDB Days 2013Replication MongoDB Days 2013
Replication MongoDB Days 2013
 
Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.
 
SE2016 Exotic Valerii Vasylkov "Erlang. Measurements and benefits"
SE2016 Exotic Valerii Vasylkov "Erlang. Measurements and benefits"SE2016 Exotic Valerii Vasylkov "Erlang. Measurements and benefits"
SE2016 Exotic Valerii Vasylkov "Erlang. Measurements and benefits"
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Dynomite at Erlang Factory

Notas del editor