• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Counters with Riak on Amazon EC2 at Hackover
 

Counters with Riak on Amazon EC2 at Hackover

on

  • 1,889 views

 

Statistics

Views

Total Views
1,889
Views on SlideShare
1,889
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Counters with Riak on Amazon EC2 at Hackover Counters with Riak on Amazon EC2 at Hackover Presentation Transcript

  • Distributed Counters with Riak on EC2 Hackover 2012 - hackathon.ro Andrei Savu - asavu@axemblr.com Twitter: @andreisavu
  • Me• Co-Founder of Axemblr.com• Co-Organiser of Bucharest JUG (bjug.ro)• OSS contributor (Apache Whirr, jclouds)• Connect with me on LinkedIn
  • ... with Riak on AWS (for fun and profit - real-time analytics)
  • Riak• Distributed Database (Key-Value)• Focused on: Availability, Fault-Tolerance, Operation Simplicity, Scalability• Each node is the same (no master)• Erlang (OTP)
  • Consistent Hashing
  • Riak - More Features• Consistent Hashing• Replication (including cross DC)• Automatic load-balancing• Hinted Handoff• Client-side conflict resolution
  • Riak Control
  • Amazon Cloud• Infrastructure as a Service (IaaS) provider• Services I use: • EC2 (compute) • ELB (load balancing) • Route53 (smart dns) • CloudWatch (monitoring)
  • Service API• GET /counters/<id>• POST /counters/<id> <value>
  • Eventual Consistency• ... and counters• Client side conflict resolution• counter => {last: 0, step: 0}
  • Basic Algorithm• {last: 1, step: 0}• +2 => {last: 1+0, step: 2} • Partition 1 • Partition 2• +3 => {last: 1+2, step: 3} • +4 => {last: 1+2, step: 4} • Fixed • Fixed• 1+(2 + 3 + 4) = 6 • read: {last: 3, step: 3 + 4}
  • Architecture US API ELB Riak w/ cross DC + replicationRoute53 UE API
  • Demo TimeLocal Machine and on Amazon EC2 (two regions)
  • Demo Resources• riak-ec2-launcher https://github.com/andreisavu/riak-ec2- cluster-launcher• riak-dt https://github.com/basho/riak_dt
  • Resources #1• PoC for Convergent Data Types https://github.com/basho/riak_dt• Study on Convergent Data Types http://hal.inria.fr/docs/00/55/55/88/PDF/ techreport.pdf• Gist: https://gist.github.com/882055
  • Resources #2• statebox - state "monad" for automated conflict resolution https://github.com/mochi/statebox• Convergent Replicated Data Types https://github.com/aphyr/meangirls• Strong Eventual Consistency and Conflict-free Replicated Data Types http://research.microsoft.com/apps/video/ default.aspx?id=153540
  • Resources #3• Cassandra Counters http://wiki.apache.org/cassandra/Counters• Convergent Replicated Data Types - SRC Fringe https://speakerdeck.com/bryce/convergent- replicated-data-types-src-fringe• http://amattn.com/2012/09/07/ riaks_two_contentions_and_crdts.html
  • Thanks! Questions? Andrei Savu - asavu@axemblr.com Twitter: @andreisavu