SlideShare a Scribd company logo
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
Counters with Riak on Amazon EC2 at Hackover
... 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
  +
                        replication
Route53   UE
               API
Demo Time
Local 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
Counters with Riak on Amazon EC2 at Hackover
Thanks! Questions?
  Andrei Savu - asavu@axemblr.com
        Twitter: @andreisavu

More Related Content

What's hot (18)

PDF
GraphQL API on a Serverless Environment
Itai Yaffe
 
PDF
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Spec + onyx
Simon Belak
 
PDF
とりあえず使うScalaz
Shuya Tsukamoto
 
ODP
Log aggregation and analysis
Dhaval Mehta
 
PPTX
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
BizTalk360
 
PPTX
Scala.js: Next generation front end development in Scala
Otto Chrons
 
PPTX
Paws - A Perl AWS SDK
Jose Luis Martínez
 
PDF
Meetup Angular.JS #12 Paris
Sylvain Utard
 
PDF
Kibana + timelion: time series with the elastic stack
Sylvain Wallez
 
PDF
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
PPTX
Paws - Perl AWS SDK Update - November 2015
Jose Luis Martínez
 
PPTX
Building an aws sdk for Perl - Granada Perl Workshop 2014
Jose Luis Martínez
 
PDF
Apache Spark avec NodeJS ? Oui, c'est possible avec EclairJS !
Bruno Bonnin
 
PDF
Vocanic Map Reduce Lite
Shreeniwas Iyer
 
PDF
libAttachSQL, The Next-Generation C Connector For MySQL
Andrew Hutchings
 
PDF
Airflow presentation
Ilias Okacha
 
PDF
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Codemotion
 
GraphQL API on a Serverless Environment
Itai Yaffe
 
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Spec + onyx
Simon Belak
 
とりあえず使うScalaz
Shuya Tsukamoto
 
Log aggregation and analysis
Dhaval Mehta
 
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
BizTalk360
 
Scala.js: Next generation front end development in Scala
Otto Chrons
 
Paws - A Perl AWS SDK
Jose Luis Martínez
 
Meetup Angular.JS #12 Paris
Sylvain Utard
 
Kibana + timelion: time series with the elastic stack
Sylvain Wallez
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
Paws - Perl AWS SDK Update - November 2015
Jose Luis Martínez
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Jose Luis Martínez
 
Apache Spark avec NodeJS ? Oui, c'est possible avec EclairJS !
Bruno Bonnin
 
Vocanic Map Reduce Lite
Shreeniwas Iyer
 
libAttachSQL, The Next-Generation C Connector For MySQL
Andrew Hutchings
 
Airflow presentation
Ilias Okacha
 
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Codemotion
 

Viewers also liked (9)

PDF
Supervisord, The Process Manager
samof76
 
PPT
Riak a successful failure
GiltTech
 
PDF
Riak - From Small to Large
Rusty Klophaus
 
PDF
Distributed Key-Value Stores- Featuring Riak
samof76
 
KEY
Riak in Ten Minutes
Jon Meredith
 
KEY
Introducing Riak
Kevin Smith
 
PDF
Relational Databases to Riak
Basho Technologies
 
KEY
Introduction to Riak - Red Dirt Ruby Conf Training
Sean Cribbs
 
PDF
Intro to riak
Jaseem Abid
 
Supervisord, The Process Manager
samof76
 
Riak a successful failure
GiltTech
 
Riak - From Small to Large
Rusty Klophaus
 
Distributed Key-Value Stores- Featuring Riak
samof76
 
Riak in Ten Minutes
Jon Meredith
 
Introducing Riak
Kevin Smith
 
Relational Databases to Riak
Basho Technologies
 
Introduction to Riak - Red Dirt Ruby Conf Training
Sean Cribbs
 
Intro to riak
Jaseem Abid
 

Similar to Counters with Riak on Amazon EC2 at Hackover (20)

KEY
Eventually-Consistent Data Structures
Sean Cribbs
 
KEY
Adding Riak to your NoSQL Bag of Tricks
siculars
 
PDF
Riak at The NYC Cloud Computing Meetup Group
siculars
 
PDF
On Rails with Apache Cassandra
Stu Hood
 
PDF
Cassandra Talk: Austin JUG
Stu Hood
 
KEY
Eventually Consistent Data Structures (from strangeloop12)
Sean Cribbs
 
PPTX
Convergent Replicated Data Types in Riak 2.0
Big Data Spain
 
PDF
Self healing data
Uwe Friedrichsen
 
PDF
Introduction to Riak - Joel Jacobson
akqaanoraks
 
PDF
Scalable Data Storage Getting You Down? To The Cloud!
Mikhail Panchenko
 
PDF
Scalable Data Storage Getting you Down? To the Cloud!
Mikhail Panchenko
 
KEY
Introducing Riak
Kevin Smith
 
PPTX
NoSQL Introduction, Theory, Implementations
Firat Atagun
 
PDF
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
DataStax
 
PDF
First review presentation
Arvind Krishnaa
 
ODP
Distributed systems and consistency
seldo
 
PDF
Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Flink Forward
 
PDF
No stress with state
Uwe Friedrichsen
 
PDF
SDEC2011 NoSQL concepts and models
Korea Sdec
 
Eventually-Consistent Data Structures
Sean Cribbs
 
Adding Riak to your NoSQL Bag of Tricks
siculars
 
Riak at The NYC Cloud Computing Meetup Group
siculars
 
On Rails with Apache Cassandra
Stu Hood
 
Cassandra Talk: Austin JUG
Stu Hood
 
Eventually Consistent Data Structures (from strangeloop12)
Sean Cribbs
 
Convergent Replicated Data Types in Riak 2.0
Big Data Spain
 
Self healing data
Uwe Friedrichsen
 
Introduction to Riak - Joel Jacobson
akqaanoraks
 
Scalable Data Storage Getting You Down? To The Cloud!
Mikhail Panchenko
 
Scalable Data Storage Getting you Down? To the Cloud!
Mikhail Panchenko
 
Introducing Riak
Kevin Smith
 
NoSQL Introduction, Theory, Implementations
Firat Atagun
 
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
DataStax
 
First review presentation
Arvind Krishnaa
 
Distributed systems and consistency
seldo
 
Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Flink Forward
 
No stress with state
Uwe Friedrichsen
 
SDEC2011 NoSQL concepts and models
Korea Sdec
 

More from Andrei Savu (20)

PDF
The Evolving Landscape of Data Engineering
Andrei Savu
 
PDF
The Evolving Landscape of Data Engineering
Andrei Savu
 
PDF
Recap on AWS Lambda after re:Invent 2015
Andrei Savu
 
PDF
One Hadoop, Multiple Clouds - NYC Big Data Meetup
Andrei Savu
 
PDF
Introducing Cloudera Director at Big Data Bash
Andrei Savu
 
PDF
APIs & Underlying Protocols #APICraftSF
Andrei Savu
 
PDF
Challenges for running Hadoop on AWS - AdvancedAWS Meetup
Andrei Savu
 
PDF
Cloud as a Data Platform
Andrei Savu
 
PDF
Apache Provisionr (incubating) - Bucharest JUG 10
Andrei Savu
 
PDF
Creating pools of Virtual Machines - ApacheCon NA 2013
Andrei Savu
 
PDF
Data Scientist Toolbox
Andrei Savu
 
PDF
Axemblr Provisionr 0.3.x Overview
Andrei Savu
 
PDF
2012 in Review - Bucharest JUG
Andrei Savu
 
PDF
Metrics for Web Applications - Netcamp 2012
Andrei Savu
 
PDF
Simple REST with Dropwizard
Andrei Savu
 
PDF
Guava Overview Part 2 Bucharest JUG #2
Andrei Savu
 
PDF
Guava Overview. Part 1 @ Bucharest JUG #1
Andrei Savu
 
KEY
Polyglot Persistence & Big Data in the Cloud
Andrei Savu
 
PDF
Building a Great Team in Open Source - Open Agile 2011
Andrei Savu
 
PDF
Apache Whirr
Andrei Savu
 
The Evolving Landscape of Data Engineering
Andrei Savu
 
The Evolving Landscape of Data Engineering
Andrei Savu
 
Recap on AWS Lambda after re:Invent 2015
Andrei Savu
 
One Hadoop, Multiple Clouds - NYC Big Data Meetup
Andrei Savu
 
Introducing Cloudera Director at Big Data Bash
Andrei Savu
 
APIs & Underlying Protocols #APICraftSF
Andrei Savu
 
Challenges for running Hadoop on AWS - AdvancedAWS Meetup
Andrei Savu
 
Cloud as a Data Platform
Andrei Savu
 
Apache Provisionr (incubating) - Bucharest JUG 10
Andrei Savu
 
Creating pools of Virtual Machines - ApacheCon NA 2013
Andrei Savu
 
Data Scientist Toolbox
Andrei Savu
 
Axemblr Provisionr 0.3.x Overview
Andrei Savu
 
2012 in Review - Bucharest JUG
Andrei Savu
 
Metrics for Web Applications - Netcamp 2012
Andrei Savu
 
Simple REST with Dropwizard
Andrei Savu
 
Guava Overview Part 2 Bucharest JUG #2
Andrei Savu
 
Guava Overview. Part 1 @ Bucharest JUG #1
Andrei Savu
 
Polyglot Persistence & Big Data in the Cloud
Andrei Savu
 
Building a Great Team in Open Source - Open Agile 2011
Andrei Savu
 
Apache Whirr
Andrei Savu
 

Counters with Riak on Amazon EC2 at Hackover

  • 1. Distributed Counters with Riak on EC2 Hackover 2012 - hackathon.ro Andrei Savu - [email protected] Twitter: @andreisavu
  • 2. Me • Co-Founder of Axemblr.com • Co-Organiser of Bucharest JUG (bjug.ro) • OSS contributor (Apache Whirr, jclouds) • Connect with me on LinkedIn
  • 4. ... with Riak on AWS (for fun and profit - real-time analytics)
  • 5. Riak • Distributed Database (Key-Value) • Focused on: Availability, Fault-Tolerance, Operation Simplicity, Scalability • Each node is the same (no master) • Erlang (OTP)
  • 7. Riak - More Features • Consistent Hashing • Replication (including cross DC) • Automatic load-balancing • Hinted Handoff • Client-side conflict resolution
  • 9. Amazon Cloud • Infrastructure as a Service (IaaS) provider • Services I use: • EC2 (compute) • ELB (load balancing) • Route53 (smart dns) • CloudWatch (monitoring)
  • 10. Service API • GET /counters/<id> • POST /counters/<id> <value>
  • 11. Eventual Consistency • ... and counters • Client side conflict resolution • counter => {last: 0, step: 0}
  • 12. 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}
  • 13. Architecture US API ELB Riak w/ cross DC + replication Route53 UE API
  • 14. Demo Time Local Machine and on Amazon EC2 (two regions)
  • 15. Demo Resources • riak-ec2-launcher https://github.com/andreisavu/riak-ec2- cluster-launcher • riak-dt https://github.com/basho/riak_dt
  • 16. 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
  • 17. 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
  • 18. 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
  • 20. Thanks! Questions? Andrei Savu - [email protected] Twitter: @andreisavu

Editor's Notes