SlideShare a Scribd company logo
1 of 145
Download to read offline
Introducing Riak and Ripple
          Sean Cribbs




Wednesday, April 14, 2010
system “whoami”




Wednesday, April 14, 2010
system “whoami”

               BCS, three years as a musician




Wednesday, April 14, 2010
system “whoami”

               BCS, three years as a musician
               Started with Ruby in early 2006




Wednesday, April 14, 2010
system “whoami”

               BCS, three years as a musician
               Started with Ruby in early 2006
               Rails freelancer 2007-2010




Wednesday, April 14, 2010
system “whoami”

               BCS, three years as a musician
               Started with Ruby in early 2006
               Rails freelancer 2007-2010
               Radiant CMS




Wednesday, April 14, 2010
system “whoami”

               BCS, three years as a musician
               Started with Ruby in early 2006
               Rails freelancer 2007-2010
               Radiant CMS
               March 2010 - Developer Advocate
                                                 basho
Wednesday, April 14, 2010
Wednesday, April 14, 2010
Wednesday, April 14, 2010
Rails Can’t Scale




Wednesday, April 14, 2010
Rails Can’t Scale
                              what does it mean?




Wednesday, April 14, 2010
Ruby Rails Can’t Scale
                            what does it mean?




Wednesday, April 14, 2010
MySQL
         Ruby Rails Can’t Scale
                            what does it mean?




Wednesday, April 14, 2010
insert straw man here


           MySQL
         Ruby Rails Can’t Scale
                            what does it mean?




Wednesday, April 14, 2010
Mythbusting “scalability”




Wednesday, April 14, 2010
Mythbusting “scalability”

               Scalability is not a yes/no question




Wednesday, April 14, 2010
Mythbusting “scalability”

               Scalability is not a yes/no question
               It’s a ratio of benefit to cost




Wednesday, April 14, 2010
Mythbusting “scalability”

               Scalability is not a yes/no question
               It’s a ratio of benefit to cost
                     Benefits: low latency, throughput, uptime,
                     concurrency, reliability




Wednesday, April 14, 2010
Mythbusting “scalability”

               Scalability is not a yes/no question
               It’s a ratio of benefit to cost
                     Benefits: low latency, throughput, uptime,
                     concurrency, reliability
                     Costs: CPU, RAM, disk, bandwidth, power, hw/sw




Wednesday, April 14, 2010
Mythbusting “scalability”

               Scalability is not a yes/no question
               It’s a ratio of benefit to cost
                     Benefits: low latency, throughput, uptime,
                     concurrency, reliability
                     Costs: CPU, RAM, disk, bandwidth, power, hw/sw
               scalability = bang for your buck (ROI)



Wednesday, April 14, 2010
Scaling goes both ways




Wednesday, April 14, 2010
Scaling goes both ways


               Up - high traffic, “Big Data”, multi-datacenter




Wednesday, April 14, 2010
Scaling goes both ways


               Up - high traffic, “Big Data”, multi-datacenter
               Down - laptop, set-top, mobile




Wednesday, April 14, 2010
How do you scale?




Wednesday, April 14, 2010
How do you scale?


               Vertically - get bigger, expensive machines




Wednesday, April 14, 2010
How do you scale?


               Vertically - get bigger, expensive machines
               Horizontally - get more commodity machines




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)
                     key-value storage




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)
                     key-value storage
                     masterless, peer-to-peer replication




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)
                     key-value storage
                     masterless, peer-to-peer replication
                     consistent hashing




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)
                     key-value storage
                     masterless, peer-to-peer replication
                     consistent hashing
                     eventual consistency




Wednesday, April 14, 2010
What is Riak?
                            (the horizontal scaling bits)

               Based on Amazon’s Dynamo (2007)
                     key-value storage
                     masterless, peer-to-peer replication
                     consistent hashing
                     eventual consistency
                     failover - quorums, hinted handoff



Wednesday, April 14, 2010
“O/RM is the Vietnam of Computer Science.”
                                 -- Ted Neward, 2004/6




Wednesday, April 14, 2010
“O/RM is the Vietnam of Computer Science.”
                                 -- Ted Neward, 2004/6
                            slippery slope




Wednesday, April 14, 2010
“O/RM is the Vietnam of Computer Science.”
                                 -- Ted Neward, 2004/6
                            slippery slope   diminishing returns




Wednesday, April 14, 2010
Impedance mismatch




Wednesday, April 14, 2010
Impedance mismatch


               Relational = predicate logic, truth statements




Wednesday, April 14, 2010
Impedance mismatch


               Relational = predicate logic, truth statements
               Object = identity, state, behavior, encapsulation




Wednesday, April 14, 2010
Pick your poison




Wednesday, April 14, 2010
Pick your poison

               Make the objects fit the database




Wednesday, April 14, 2010
Pick your poison

               Make the objects fit the database
                     Active Record




Wednesday, April 14, 2010
Pick your poison

               Make the objects fit the database
                     Active Record
               Make the database fit the objects




Wednesday, April 14, 2010
Pick your poison

               Make the objects fit the database
                     Active Record
               Make the database fit the objects
                     OODBMS, Graph DBs




Wednesday, April 14, 2010
Middle ground




Wednesday, April 14, 2010
Middle ground

               Document databases (identity and state)




Wednesday, April 14, 2010
Middle ground

               Document databases (identity and state)
                     No JOINs - denormalized / composed




Wednesday, April 14, 2010
Middle ground

               Document databases (identity and state)
                     No JOINs - denormalized / composed
                     Loosely structured




Wednesday, April 14, 2010
Middle ground

               Document databases (identity and state)
                     No JOINs - denormalized / composed
                     Loosely structured
                     Friendly transport formats, e.g. JSON




Wednesday, April 14, 2010
What is Riak?
                            (the document database bits)




Wednesday, April 14, 2010
What is Riak?
                            (the document database bits)



               Store your objects as JSON (or any format)




Wednesday, April 14, 2010
What is Riak?
                            (the document database bits)



               Store your objects as JSON (or any format)
               Link between objects (like hypertext)




Wednesday, April 14, 2010
What is Riak?
                            (the document database bits)



               Store your objects as JSON (or any format)
               Link between objects (like hypertext)
               No SQL - query with Javascript Map-Reduce




Wednesday, April 14, 2010
“DevOps” - agile infrastructure




Wednesday, April 14, 2010
“DevOps” - agile infrastructure
                            programming your infrastructure




Wednesday, April 14, 2010
“DevOps” - agile infrastructure
                            programming your infrastructure
                               rapid “cloud” deployments




Wednesday, April 14, 2010
Befriend your sysadmin




Wednesday, April 14, 2010
Befriend your sysadmin


               Integrate with existing infrastructure




Wednesday, April 14, 2010
Befriend your sysadmin


               Integrate with existing infrastructure
               Reduce the amount of hands-on work




Wednesday, April 14, 2010
Befriend your sysadmin


               Integrate with existing infrastructure
               Reduce the amount of hands-on work
               Have a growth plan




Wednesday, April 14, 2010
What is Riak?
                            (the ops-friendly bits)




Wednesday, April 14, 2010
What is Riak?
                            (the ops-friendly bits)

               Web-shaped storage




Wednesday, April 14, 2010
What is Riak?
                               (the ops-friendly bits)

               Web-shaped storage
                     Store data in its original format




Wednesday, April 14, 2010
What is Riak?
                               (the ops-friendly bits)

               Web-shaped storage
                     Store data in its original format
                     It’s just HTTP - same techniques apply




Wednesday, April 14, 2010
What is Riak?
                                   (the ops-friendly bits)

               Web-shaped storage
                     Store data in its original format
                     It’s just HTTP - same techniques apply
                            load balancing, proxy caches, round-robin DNS




Wednesday, April 14, 2010
What is Riak?
                                   (the ops-friendly bits)

               Web-shaped storage
                     Store data in its original format
                     It’s just HTTP - same techniques apply
                            load balancing, proxy caches, round-robin DNS
               No node is special - grow horizontally




Wednesday, April 14, 2010
What is Riak?
                                   (the ops-friendly bits)

               Web-shaped storage
                     Store data in its original format
                     It’s just HTTP - same techniques apply
                            load balancing, proxy caches, round-robin DNS
               No node is special - grow horizontally
               Get some sleep, fix it in the morning



Wednesday, April 14, 2010
To review, Riak is...




Wednesday, April 14, 2010
To review, Riak is...

               Magical Horizontally-
               Scaling Unicorns




Wednesday, April 14, 2010
To review, Riak is...

               Magical Horizontally-
               Scaling Unicorns
               Application-Friendly
               Rainbows in the Cloud




Wednesday, April 14, 2010
To review, Riak is...

               Magical Horizontally-
               Scaling Unicorns
               Application-Friendly
               Rainbows in the Cloud
               Data-Shredding
               MapReduce Ninjas




Wednesday, April 14, 2010
http://downloads.basho.com/riak/
                            hg clone http://hg.basho.com/riak/




Wednesday, April 14, 2010
gem install ripple
               git clone git://github.com/seancribbs/ripple.git




Wednesday, April 14, 2010
CRUD in Riak




Wednesday, April 14, 2010
CRUD in Riak


               PUT /riak/bucket/key (C,U) (also POST)




Wednesday, April 14, 2010
CRUD in Riak


               PUT /riak/bucket/key (C,U) (also POST)
               GET /riak/bucket/key (R)




Wednesday, April 14, 2010
CRUD in Riak


               PUT /riak/bucket/key (C,U) (also POST)
               GET /riak/bucket/key (R)
               DELETE /riak/bucket/key (D)




Wednesday, April 14, 2010
CRUD Demo




Wednesday, April 14, 2010
Links




Wednesday, April 14, 2010
Links


               One-way, qualified “pointers” to other objects




Wednesday, April 14, 2010
Links


               One-way, qualified “pointers” to other objects
               “Link” header in HTTP




Wednesday, April 14, 2010
Links


               One-way, qualified “pointers” to other objects
               “Link” header in HTTP
               </riak/bucket/key>; riaktag=”tag”




Wednesday, April 14, 2010
Link-walking




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket
                     tag = scope to a tag




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket
                     tag = scope to a tag
                     keep = return results (last one always)




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket
                     tag = scope to a tag
                     keep = return results (last one always)
                     “_” means match anything




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket
                     tag = scope to a tag
                     keep = return results (last one always)
                     “_” means match anything
               Example:




Wednesday, April 14, 2010
Link-walking
               GET /riak/bucket/key/[bucket,tag,keep]*
                     bucket = scope to a bucket
                     tag = scope to a tag
                     keep = return results (last one always)
                     “_” means match anything
               Example:
                     GET /riak/artists/TheBeatles/albums,_,1/tracks,_,1


Wednesday, April 14, 2010
Links Demo




Wednesday, April 14, 2010
Riak Map-Reduce
          I believe I did, Bob.

Wednesday, April 14, 2010
Riak Map-Reduce




Wednesday, April 14, 2010
Riak Map-Reduce

               Based on Google’s Map-Reduce idea




Wednesday, April 14, 2010
Riak Map-Reduce

               Based on Google’s Map-Reduce idea
               Some similarities to Hadoop and CouchDB




Wednesday, April 14, 2010
Riak Map-Reduce

               Based on Google’s Map-Reduce idea
               Some similarities to Hadoop and CouchDB
               High data-locality




Wednesday, April 14, 2010
Riak Map-Reduce

               Based on Google’s Map-Reduce idea
               Some similarities to Hadoop and CouchDB
               High data-locality
               Phases can be Javascript or Erlang




Wednesday, April 14, 2010
Map-Reduce Terminology




Wednesday, April 14, 2010
Map-Reduce Terminology

               Job: a query, composed of inputs and phases




Wednesday, April 14, 2010
Map-Reduce Terminology

               Job: a query, composed of inputs and phases
               Phase: a single map or reduce function application




Wednesday, April 14, 2010
Map-Reduce Terminology

               Job: a query, composed of inputs and phases
               Phase: a single map or reduce function application
               Map: phase applied to each item - filter, transform




Wednesday, April 14, 2010
Map-Reduce Terminology

               Job: a query, composed of inputs and phases
               Phase: a single map or reduce function application
               Map: phase applied to each item - filter, transform
               Reduce: phase applied to the collection - collate,
               aggregate, compute




Wednesday, April 14, 2010
Map Phases




Wednesday, April 14, 2010
Map Phases


               Inputs are bucket-key pairs (with optional key-specific
               data)




Wednesday, April 14, 2010
Map Phases


               Inputs are bucket-key pairs (with optional key-specific
               data)
               Must return a list




Wednesday, April 14, 2010
Map Phases


               Inputs are bucket-key pairs (with optional key-specific
               data)
               Must return a list
               Parallel results are aggregated




Wednesday, April 14, 2010
Map Built-ins




Wednesday, April 14, 2010
Map Built-ins


               Riak.mapValues




Wednesday, April 14, 2010
Map Built-ins


               Riak.mapValues
               Riak.mapValuesJson




Wednesday, April 14, 2010
Reduce Phases




Wednesday, April 14, 2010
Reduce Phases


               Performed on a single node




Wednesday, April 14, 2010
Reduce Phases


               Performed on a single node
               Two processes per reduce phase increase parallelism




Wednesday, April 14, 2010
Reduce Phases


               Performed on a single node
               Two processes per reduce phase increase parallelism
               Must return a list




Wednesday, April 14, 2010
Reduce Built-ins




Wednesday, April 14, 2010
Reduce Built-ins


               Riak.reduceMin




Wednesday, April 14, 2010
Reduce Built-ins


               Riak.reduceMin
               Riak.reduceMax




Wednesday, April 14, 2010
Reduce Built-ins


               Riak.reduceMin
               Riak.reduceMax
               Riak.reduceSort




Wednesday, April 14, 2010
Build a M/R Job




Wednesday, April 14, 2010
Build a M/R Job

               Specify inputs




Wednesday, April 14, 2010
Build a M/R Job

               Specify inputs
                     bucket/key, bucket/key/key-specific-arg, bucket




Wednesday, April 14, 2010
Build a M/R Job

               Specify inputs
                     bucket/key, bucket/key/key-specific-arg, bucket
               Specify phases




Wednesday, April 14, 2010
Build a M/R Job

               Specify inputs
                     bucket/key, bucket/key/key-specific-arg, bucket
               Specify phases
                     Each can receive a static argument




Wednesday, April 14, 2010
Build a M/R Job

               Specify inputs
                     bucket/key, bucket/key/key-specific-arg, bucket
               Specify phases
                     Each can receive a static argument
                     Each can return intermediate results




Wednesday, April 14, 2010
Map-Reduce on HTTP




Wednesday, April 14, 2010
Map-Reduce on HTTP


               Job is a JSON object




Wednesday, April 14, 2010
Map-Reduce on HTTP


               Job is a JSON object
               POST /mapred




Wednesday, April 14, 2010
A simple M/R job

           {“inputs”: “goog”,

              “query”: [{“map”:

                            {“language”:”javascript”,

                             “name”: “Riak.mapValuesJson”,

                            “keep”: true}]}




Wednesday, April 14, 2010
A simple M/R job

           {“inputs”: “goog”,

              “query”: [{“map”:

                            {“language”:”javascript”,

                             “name”: “Riak.mapValuesJson”,

                            “keep”: true}]}


                Riak::MapReduce.new(c).add(‘goog’).
                     map(‘Riak.mapValuesJson’, :keep => true).run




Wednesday, April 14, 2010
Another M/R Job
                 {“inputs”: “stocks”,

                   “query”: [{“map”:{“language”:”javascript”,

                                     “name”: “App.extractTickers”,

                                     “arg”: “GOOG”,

                                     “keep”: false},

                             {“reduce”:{“language”:”javascript,

                                        “name”: “Riak.reduceMin”,

                                        “keep”: true}]}




Wednesday, April 14, 2010
Another M/R Job
                 {“inputs”: “stocks”,

                   “query”: [{“map”:{“language”:”javascript”,

                                     “name”: “App.extractTickers”,

                                     “arg”: “GOOG”,

                                     “keep”: false},

                             {“reduce”:{“language”:”javascript,

                                        “name”: “Riak.reduceMin”,

                                        “keep”: true}]}

                Riak::MapReduce.new(c).add(‘stocks’).
                     map(‘App.extractTickers’, :arg =>”GOOG”).
                     reduce(“Riak.reduceMin”, :keep => true).run


Wednesday, April 14, 2010
Map-Reduce Demo




Wednesday, April 14, 2010
Ripple




Wednesday, April 14, 2010
Ripple

               Document-style persistence (like MongoMapper)




Wednesday, April 14, 2010
Ripple

               Document-style persistence (like MongoMapper)
               ActiveModel niceties




Wednesday, April 14, 2010
Ripple

               Document-style persistence (like MongoMapper)
               ActiveModel niceties
                     Callbacks




Wednesday, April 14, 2010
Ripple

               Document-style persistence (like MongoMapper)
               ActiveModel niceties
                     Callbacks
                     Validations




Wednesday, April 14, 2010
Ripple

               Document-style persistence (like MongoMapper)
               ActiveModel niceties
                     Callbacks
                     Validations
                     ActionPack compatibility




Wednesday, April 14, 2010
Ripple TODO




Wednesday, April 14, 2010
Ripple TODO

               Associations




Wednesday, April 14, 2010
Ripple TODO

               Associations
               Indexes




Wednesday, April 14, 2010
Ripple TODO

               Associations
               Indexes
               Use a property/method as the key




Wednesday, April 14, 2010
Ripple TODO

               Associations
               Indexes
               Use a property/method as the key
               Dynamic finders




Wednesday, April 14, 2010
Ripple TODO

               Associations
               Indexes
               Use a property/method as the key
               Dynamic finders
               Session/cache stores




Wednesday, April 14, 2010
Ripple Demo




Wednesday, April 14, 2010
sean@basho.com
                                                 @seancribbs
                            “seancribbs” on Freenode IRC #riak



          Questions?
                                         http://wiki.basho.com
                                   riak-users@lists.basho.com




Wednesday, April 14, 2010

More Related Content

Similar to Introducing Riak and Ripple

Caelum dicas web 2010
Caelum dicas web 2010Caelum dicas web 2010
Caelum dicas web 2010Fabio Akita
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability PatternsRobert Treat
 
Making your oss project more like rails
Making your oss project more like railsMaking your oss project more like rails
Making your oss project more like railsYehuda Katz
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Boris Mann
 
JSONH & Mobile APIs
JSONH & Mobile APIsJSONH & Mobile APIs
JSONH & Mobile APIsKet Majmudar
 
The Mobile Web @ 2010 JSConf
The Mobile Web @ 2010 JSConfThe Mobile Web @ 2010 JSConf
The Mobile Web @ 2010 JSConfdion
 
Edted 2010 Dicas de Web
Edted 2010 Dicas de WebEdted 2010 Dicas de Web
Edted 2010 Dicas de WebFabio Akita
 
Web5 pushing the web forward.apr
Web5 pushing the web forward.aprWeb5 pushing the web forward.apr
Web5 pushing the web forward.aprArnout Kazemier
 
Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Giuseppe Maxia
 
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...aungstad
 

Similar to Introducing Riak and Ripple (12)

Caelum dicas web 2010
Caelum dicas web 2010Caelum dicas web 2010
Caelum dicas web 2010
 
20100714accel
20100714accel20100714accel
20100714accel
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability Patterns
 
Making your oss project more like rails
Making your oss project more like railsMaking your oss project more like rails
Making your oss project more like rails
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
 
Persistence Smoothie
Persistence SmoothiePersistence Smoothie
Persistence Smoothie
 
JSONH & Mobile APIs
JSONH & Mobile APIsJSONH & Mobile APIs
JSONH & Mobile APIs
 
The Mobile Web @ 2010 JSConf
The Mobile Web @ 2010 JSConfThe Mobile Web @ 2010 JSConf
The Mobile Web @ 2010 JSConf
 
Edted 2010 Dicas de Web
Edted 2010 Dicas de WebEdted 2010 Dicas de Web
Edted 2010 Dicas de Web
 
Web5 pushing the web forward.apr
Web5 pushing the web forward.aprWeb5 pushing the web forward.apr
Web5 pushing the web forward.apr
 
Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012
 
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
 

More from Sean Cribbs

Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Sean Cribbs
 
Eventually-Consistent Data Structures
Eventually-Consistent Data StructuresEventually-Consistent Data Structures
Eventually-Consistent Data StructuresSean Cribbs
 
A Case of Accidental Concurrency
A Case of Accidental ConcurrencyA Case of Accidental Concurrency
A Case of Accidental ConcurrencySean Cribbs
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleSean Cribbs
 
Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Sean Cribbs
 
Riak (Øredev nosql day)
Riak (Øredev nosql day)Riak (Øredev nosql day)
Riak (Øredev nosql day)Sean Cribbs
 
Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Sean Cribbs
 
The Radiant Ethic
The Radiant EthicThe Radiant Ethic
The Radiant EthicSean Cribbs
 
Schema Design for Riak
Schema Design for RiakSchema Design for Riak
Schema Design for RiakSean Cribbs
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingSean Cribbs
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangSean Cribbs
 
Of Rats And Dragons
Of Rats And DragonsOf Rats And Dragons
Of Rats And DragonsSean Cribbs
 
Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for RubyistsSean Cribbs
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainSean Cribbs
 

More from Sean Cribbs (16)

Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)
 
Eventually-Consistent Data Structures
Eventually-Consistent Data StructuresEventually-Consistent Data Structures
Eventually-Consistent Data Structures
 
A Case of Accidental Concurrency
A Case of Accidental ConcurrencyA Case of Accidental Concurrency
A Case of Accidental Concurrency
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)Schema Design for Riak (Take 2)
Schema Design for Riak (Take 2)
 
Riak (Øredev nosql day)
Riak (Øredev nosql day)Riak (Øredev nosql day)
Riak (Øredev nosql day)
 
Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Riak Tutorial (Øredev)
Riak Tutorial (Øredev)
 
The Radiant Ethic
The Radiant EthicThe Radiant Ethic
The Radiant Ethic
 
Riak with Rails
Riak with RailsRiak with Rails
Riak with Rails
 
Schema Design for Riak
Schema Design for RiakSchema Design for Riak
Schema Design for Riak
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf Training
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
 
Of Rats And Dragons
Of Rats And DragonsOf Rats And Dragons
Of Rats And Dragons
 
Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for Rubyists
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your Brain
 

Recently uploaded

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Recently uploaded (20)

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

Introducing Riak and Ripple

  • 1. Introducing Riak and Ripple Sean Cribbs Wednesday, April 14, 2010
  • 3. system “whoami” BCS, three years as a musician Wednesday, April 14, 2010
  • 4. system “whoami” BCS, three years as a musician Started with Ruby in early 2006 Wednesday, April 14, 2010
  • 5. system “whoami” BCS, three years as a musician Started with Ruby in early 2006 Rails freelancer 2007-2010 Wednesday, April 14, 2010
  • 6. system “whoami” BCS, three years as a musician Started with Ruby in early 2006 Rails freelancer 2007-2010 Radiant CMS Wednesday, April 14, 2010
  • 7. system “whoami” BCS, three years as a musician Started with Ruby in early 2006 Rails freelancer 2007-2010 Radiant CMS March 2010 - Developer Advocate basho Wednesday, April 14, 2010
  • 11. Rails Can’t Scale what does it mean? Wednesday, April 14, 2010
  • 12. Ruby Rails Can’t Scale what does it mean? Wednesday, April 14, 2010
  • 13. MySQL Ruby Rails Can’t Scale what does it mean? Wednesday, April 14, 2010
  • 14. insert straw man here MySQL Ruby Rails Can’t Scale what does it mean? Wednesday, April 14, 2010
  • 16. Mythbusting “scalability” Scalability is not a yes/no question Wednesday, April 14, 2010
  • 17. Mythbusting “scalability” Scalability is not a yes/no question It’s a ratio of benefit to cost Wednesday, April 14, 2010
  • 18. Mythbusting “scalability” Scalability is not a yes/no question It’s a ratio of benefit to cost Benefits: low latency, throughput, uptime, concurrency, reliability Wednesday, April 14, 2010
  • 19. Mythbusting “scalability” Scalability is not a yes/no question It’s a ratio of benefit to cost Benefits: low latency, throughput, uptime, concurrency, reliability Costs: CPU, RAM, disk, bandwidth, power, hw/sw Wednesday, April 14, 2010
  • 20. Mythbusting “scalability” Scalability is not a yes/no question It’s a ratio of benefit to cost Benefits: low latency, throughput, uptime, concurrency, reliability Costs: CPU, RAM, disk, bandwidth, power, hw/sw scalability = bang for your buck (ROI) Wednesday, April 14, 2010
  • 21. Scaling goes both ways Wednesday, April 14, 2010
  • 22. Scaling goes both ways Up - high traffic, “Big Data”, multi-datacenter Wednesday, April 14, 2010
  • 23. Scaling goes both ways Up - high traffic, “Big Data”, multi-datacenter Down - laptop, set-top, mobile Wednesday, April 14, 2010
  • 24. How do you scale? Wednesday, April 14, 2010
  • 25. How do you scale? Vertically - get bigger, expensive machines Wednesday, April 14, 2010
  • 26. How do you scale? Vertically - get bigger, expensive machines Horizontally - get more commodity machines Wednesday, April 14, 2010
  • 27. What is Riak? (the horizontal scaling bits) Wednesday, April 14, 2010
  • 28. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) Wednesday, April 14, 2010
  • 29. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) key-value storage Wednesday, April 14, 2010
  • 30. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) key-value storage masterless, peer-to-peer replication Wednesday, April 14, 2010
  • 31. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) key-value storage masterless, peer-to-peer replication consistent hashing Wednesday, April 14, 2010
  • 32. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) key-value storage masterless, peer-to-peer replication consistent hashing eventual consistency Wednesday, April 14, 2010
  • 33. What is Riak? (the horizontal scaling bits) Based on Amazon’s Dynamo (2007) key-value storage masterless, peer-to-peer replication consistent hashing eventual consistency failover - quorums, hinted handoff Wednesday, April 14, 2010
  • 34. “O/RM is the Vietnam of Computer Science.” -- Ted Neward, 2004/6 Wednesday, April 14, 2010
  • 35. “O/RM is the Vietnam of Computer Science.” -- Ted Neward, 2004/6 slippery slope Wednesday, April 14, 2010
  • 36. “O/RM is the Vietnam of Computer Science.” -- Ted Neward, 2004/6 slippery slope diminishing returns Wednesday, April 14, 2010
  • 38. Impedance mismatch Relational = predicate logic, truth statements Wednesday, April 14, 2010
  • 39. Impedance mismatch Relational = predicate logic, truth statements Object = identity, state, behavior, encapsulation Wednesday, April 14, 2010
  • 40. Pick your poison Wednesday, April 14, 2010
  • 41. Pick your poison Make the objects fit the database Wednesday, April 14, 2010
  • 42. Pick your poison Make the objects fit the database Active Record Wednesday, April 14, 2010
  • 43. Pick your poison Make the objects fit the database Active Record Make the database fit the objects Wednesday, April 14, 2010
  • 44. Pick your poison Make the objects fit the database Active Record Make the database fit the objects OODBMS, Graph DBs Wednesday, April 14, 2010
  • 46. Middle ground Document databases (identity and state) Wednesday, April 14, 2010
  • 47. Middle ground Document databases (identity and state) No JOINs - denormalized / composed Wednesday, April 14, 2010
  • 48. Middle ground Document databases (identity and state) No JOINs - denormalized / composed Loosely structured Wednesday, April 14, 2010
  • 49. Middle ground Document databases (identity and state) No JOINs - denormalized / composed Loosely structured Friendly transport formats, e.g. JSON Wednesday, April 14, 2010
  • 50. What is Riak? (the document database bits) Wednesday, April 14, 2010
  • 51. What is Riak? (the document database bits) Store your objects as JSON (or any format) Wednesday, April 14, 2010
  • 52. What is Riak? (the document database bits) Store your objects as JSON (or any format) Link between objects (like hypertext) Wednesday, April 14, 2010
  • 53. What is Riak? (the document database bits) Store your objects as JSON (or any format) Link between objects (like hypertext) No SQL - query with Javascript Map-Reduce Wednesday, April 14, 2010
  • 54. “DevOps” - agile infrastructure Wednesday, April 14, 2010
  • 55. “DevOps” - agile infrastructure programming your infrastructure Wednesday, April 14, 2010
  • 56. “DevOps” - agile infrastructure programming your infrastructure rapid “cloud” deployments Wednesday, April 14, 2010
  • 58. Befriend your sysadmin Integrate with existing infrastructure Wednesday, April 14, 2010
  • 59. Befriend your sysadmin Integrate with existing infrastructure Reduce the amount of hands-on work Wednesday, April 14, 2010
  • 60. Befriend your sysadmin Integrate with existing infrastructure Reduce the amount of hands-on work Have a growth plan Wednesday, April 14, 2010
  • 61. What is Riak? (the ops-friendly bits) Wednesday, April 14, 2010
  • 62. What is Riak? (the ops-friendly bits) Web-shaped storage Wednesday, April 14, 2010
  • 63. What is Riak? (the ops-friendly bits) Web-shaped storage Store data in its original format Wednesday, April 14, 2010
  • 64. What is Riak? (the ops-friendly bits) Web-shaped storage Store data in its original format It’s just HTTP - same techniques apply Wednesday, April 14, 2010
  • 65. What is Riak? (the ops-friendly bits) Web-shaped storage Store data in its original format It’s just HTTP - same techniques apply load balancing, proxy caches, round-robin DNS Wednesday, April 14, 2010
  • 66. What is Riak? (the ops-friendly bits) Web-shaped storage Store data in its original format It’s just HTTP - same techniques apply load balancing, proxy caches, round-robin DNS No node is special - grow horizontally Wednesday, April 14, 2010
  • 67. What is Riak? (the ops-friendly bits) Web-shaped storage Store data in its original format It’s just HTTP - same techniques apply load balancing, proxy caches, round-robin DNS No node is special - grow horizontally Get some sleep, fix it in the morning Wednesday, April 14, 2010
  • 68. To review, Riak is... Wednesday, April 14, 2010
  • 69. To review, Riak is... Magical Horizontally- Scaling Unicorns Wednesday, April 14, 2010
  • 70. To review, Riak is... Magical Horizontally- Scaling Unicorns Application-Friendly Rainbows in the Cloud Wednesday, April 14, 2010
  • 71. To review, Riak is... Magical Horizontally- Scaling Unicorns Application-Friendly Rainbows in the Cloud Data-Shredding MapReduce Ninjas Wednesday, April 14, 2010
  • 72. http://downloads.basho.com/riak/ hg clone http://hg.basho.com/riak/ Wednesday, April 14, 2010
  • 73. gem install ripple git clone git://github.com/seancribbs/ripple.git Wednesday, April 14, 2010
  • 74. CRUD in Riak Wednesday, April 14, 2010
  • 75. CRUD in Riak PUT /riak/bucket/key (C,U) (also POST) Wednesday, April 14, 2010
  • 76. CRUD in Riak PUT /riak/bucket/key (C,U) (also POST) GET /riak/bucket/key (R) Wednesday, April 14, 2010
  • 77. CRUD in Riak PUT /riak/bucket/key (C,U) (also POST) GET /riak/bucket/key (R) DELETE /riak/bucket/key (D) Wednesday, April 14, 2010
  • 80. Links One-way, qualified “pointers” to other objects Wednesday, April 14, 2010
  • 81. Links One-way, qualified “pointers” to other objects “Link” header in HTTP Wednesday, April 14, 2010
  • 82. Links One-way, qualified “pointers” to other objects “Link” header in HTTP </riak/bucket/key>; riaktag=”tag” Wednesday, April 14, 2010
  • 84. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* Wednesday, April 14, 2010
  • 85. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket Wednesday, April 14, 2010
  • 86. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket tag = scope to a tag Wednesday, April 14, 2010
  • 87. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket tag = scope to a tag keep = return results (last one always) Wednesday, April 14, 2010
  • 88. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket tag = scope to a tag keep = return results (last one always) “_” means match anything Wednesday, April 14, 2010
  • 89. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket tag = scope to a tag keep = return results (last one always) “_” means match anything Example: Wednesday, April 14, 2010
  • 90. Link-walking GET /riak/bucket/key/[bucket,tag,keep]* bucket = scope to a bucket tag = scope to a tag keep = return results (last one always) “_” means match anything Example: GET /riak/artists/TheBeatles/albums,_,1/tracks,_,1 Wednesday, April 14, 2010
  • 92. Riak Map-Reduce I believe I did, Bob. Wednesday, April 14, 2010
  • 94. Riak Map-Reduce Based on Google’s Map-Reduce idea Wednesday, April 14, 2010
  • 95. Riak Map-Reduce Based on Google’s Map-Reduce idea Some similarities to Hadoop and CouchDB Wednesday, April 14, 2010
  • 96. Riak Map-Reduce Based on Google’s Map-Reduce idea Some similarities to Hadoop and CouchDB High data-locality Wednesday, April 14, 2010
  • 97. Riak Map-Reduce Based on Google’s Map-Reduce idea Some similarities to Hadoop and CouchDB High data-locality Phases can be Javascript or Erlang Wednesday, April 14, 2010
  • 99. Map-Reduce Terminology Job: a query, composed of inputs and phases Wednesday, April 14, 2010
  • 100. Map-Reduce Terminology Job: a query, composed of inputs and phases Phase: a single map or reduce function application Wednesday, April 14, 2010
  • 101. Map-Reduce Terminology Job: a query, composed of inputs and phases Phase: a single map or reduce function application Map: phase applied to each item - filter, transform Wednesday, April 14, 2010
  • 102. Map-Reduce Terminology Job: a query, composed of inputs and phases Phase: a single map or reduce function application Map: phase applied to each item - filter, transform Reduce: phase applied to the collection - collate, aggregate, compute Wednesday, April 14, 2010
  • 104. Map Phases Inputs are bucket-key pairs (with optional key-specific data) Wednesday, April 14, 2010
  • 105. Map Phases Inputs are bucket-key pairs (with optional key-specific data) Must return a list Wednesday, April 14, 2010
  • 106. Map Phases Inputs are bucket-key pairs (with optional key-specific data) Must return a list Parallel results are aggregated Wednesday, April 14, 2010
  • 108. Map Built-ins Riak.mapValues Wednesday, April 14, 2010
  • 109. Map Built-ins Riak.mapValues Riak.mapValuesJson Wednesday, April 14, 2010
  • 111. Reduce Phases Performed on a single node Wednesday, April 14, 2010
  • 112. Reduce Phases Performed on a single node Two processes per reduce phase increase parallelism Wednesday, April 14, 2010
  • 113. Reduce Phases Performed on a single node Two processes per reduce phase increase parallelism Must return a list Wednesday, April 14, 2010
  • 115. Reduce Built-ins Riak.reduceMin Wednesday, April 14, 2010
  • 116. Reduce Built-ins Riak.reduceMin Riak.reduceMax Wednesday, April 14, 2010
  • 117. Reduce Built-ins Riak.reduceMin Riak.reduceMax Riak.reduceSort Wednesday, April 14, 2010
  • 118. Build a M/R Job Wednesday, April 14, 2010
  • 119. Build a M/R Job Specify inputs Wednesday, April 14, 2010
  • 120. Build a M/R Job Specify inputs bucket/key, bucket/key/key-specific-arg, bucket Wednesday, April 14, 2010
  • 121. Build a M/R Job Specify inputs bucket/key, bucket/key/key-specific-arg, bucket Specify phases Wednesday, April 14, 2010
  • 122. Build a M/R Job Specify inputs bucket/key, bucket/key/key-specific-arg, bucket Specify phases Each can receive a static argument Wednesday, April 14, 2010
  • 123. Build a M/R Job Specify inputs bucket/key, bucket/key/key-specific-arg, bucket Specify phases Each can receive a static argument Each can return intermediate results Wednesday, April 14, 2010
  • 124. Map-Reduce on HTTP Wednesday, April 14, 2010
  • 125. Map-Reduce on HTTP Job is a JSON object Wednesday, April 14, 2010
  • 126. Map-Reduce on HTTP Job is a JSON object POST /mapred Wednesday, April 14, 2010
  • 127. A simple M/R job {“inputs”: “goog”, “query”: [{“map”: {“language”:”javascript”, “name”: “Riak.mapValuesJson”, “keep”: true}]} Wednesday, April 14, 2010
  • 128. A simple M/R job {“inputs”: “goog”, “query”: [{“map”: {“language”:”javascript”, “name”: “Riak.mapValuesJson”, “keep”: true}]} Riak::MapReduce.new(c).add(‘goog’). map(‘Riak.mapValuesJson’, :keep => true).run Wednesday, April 14, 2010
  • 129. Another M/R Job {“inputs”: “stocks”, “query”: [{“map”:{“language”:”javascript”, “name”: “App.extractTickers”, “arg”: “GOOG”, “keep”: false}, {“reduce”:{“language”:”javascript, “name”: “Riak.reduceMin”, “keep”: true}]} Wednesday, April 14, 2010
  • 130. Another M/R Job {“inputs”: “stocks”, “query”: [{“map”:{“language”:”javascript”, “name”: “App.extractTickers”, “arg”: “GOOG”, “keep”: false}, {“reduce”:{“language”:”javascript, “name”: “Riak.reduceMin”, “keep”: true}]} Riak::MapReduce.new(c).add(‘stocks’). map(‘App.extractTickers’, :arg =>”GOOG”). reduce(“Riak.reduceMin”, :keep => true).run Wednesday, April 14, 2010
  • 133. Ripple Document-style persistence (like MongoMapper) Wednesday, April 14, 2010
  • 134. Ripple Document-style persistence (like MongoMapper) ActiveModel niceties Wednesday, April 14, 2010
  • 135. Ripple Document-style persistence (like MongoMapper) ActiveModel niceties Callbacks Wednesday, April 14, 2010
  • 136. Ripple Document-style persistence (like MongoMapper) ActiveModel niceties Callbacks Validations Wednesday, April 14, 2010
  • 137. Ripple Document-style persistence (like MongoMapper) ActiveModel niceties Callbacks Validations ActionPack compatibility Wednesday, April 14, 2010
  • 139. Ripple TODO Associations Wednesday, April 14, 2010
  • 140. Ripple TODO Associations Indexes Wednesday, April 14, 2010
  • 141. Ripple TODO Associations Indexes Use a property/method as the key Wednesday, April 14, 2010
  • 142. Ripple TODO Associations Indexes Use a property/method as the key Dynamic finders Wednesday, April 14, 2010
  • 143. Ripple TODO Associations Indexes Use a property/method as the key Dynamic finders Session/cache stores Wednesday, April 14, 2010
  • 145. sean@basho.com @seancribbs “seancribbs” on Freenode IRC #riak Questions? http://wiki.basho.com riak-users@lists.basho.com Wednesday, April 14, 2010