introducing riak and ripple
DESCRIPTION
An introduction to Basho's Riak distributed data store, and the Ripple client in Ruby. Code samples from the demos are here: http://gist.github.com/365791TRANSCRIPT
![Page 1: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/1.jpg)
Introducing Riak and RippleSean Cribbs
Wednesday, April 14, 2010
![Page 2: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/2.jpg)
system “whoami”
Wednesday, April 14, 2010
![Page 3: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/3.jpg)
system “whoami”
BCS, three years as a musician
Wednesday, April 14, 2010
![Page 4: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/4.jpg)
system “whoami”
BCS, three years as a musician
Started with Ruby in early 2006
Wednesday, April 14, 2010
![Page 5: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/5.jpg)
system “whoami”
BCS, three years as a musician
Started with Ruby in early 2006
Rails freelancer 2007-2010
Wednesday, April 14, 2010
![Page 6: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/6.jpg)
system “whoami”
BCS, three years as a musician
Started with Ruby in early 2006
Rails freelancer 2007-2010
Radiant CMS
Wednesday, April 14, 2010
![Page 7: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/7.jpg)
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
![Page 8: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/8.jpg)
Wednesday, April 14, 2010
![Page 9: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/9.jpg)
Wednesday, April 14, 2010
![Page 10: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/10.jpg)
Rails Can’t Scale
Wednesday, April 14, 2010
![Page 11: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/11.jpg)
Rails Can’t Scalewhat does it mean?
Wednesday, April 14, 2010
![Page 12: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/12.jpg)
Rails Can’t Scalewhat does it mean?
Ruby
Wednesday, April 14, 2010
![Page 13: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/13.jpg)
Rails Can’t Scalewhat does it mean?
MySQLRuby
Wednesday, April 14, 2010
![Page 14: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/14.jpg)
Rails Can’t Scalewhat does it mean?
MySQL
insert straw man here
Ruby
Wednesday, April 14, 2010
![Page 15: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/15.jpg)
Mythbusting “scalability”
Wednesday, April 14, 2010
![Page 16: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/16.jpg)
Mythbusting “scalability”
Scalability is not a yes/no question
Wednesday, April 14, 2010
![Page 17: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/17.jpg)
Mythbusting “scalability”
Scalability is not a yes/no question
It’s a ratio of benefit to cost
Wednesday, April 14, 2010
![Page 18: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/18.jpg)
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
![Page 19: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/19.jpg)
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
![Page 20: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/20.jpg)
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
![Page 21: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/21.jpg)
Scaling goes both ways
Wednesday, April 14, 2010
![Page 22: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/22.jpg)
Scaling goes both ways
Up - high traffic, “Big Data”, multi-datacenter
Wednesday, April 14, 2010
![Page 23: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/23.jpg)
Scaling goes both ways
Up - high traffic, “Big Data”, multi-datacenter
Down - laptop, set-top, mobile
Wednesday, April 14, 2010
![Page 24: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/24.jpg)
How do you scale?
Wednesday, April 14, 2010
![Page 25: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/25.jpg)
How do you scale?
Vertically - get bigger, expensive machines
Wednesday, April 14, 2010
![Page 26: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/26.jpg)
How do you scale?
Vertically - get bigger, expensive machines
Horizontally - get more commodity machines
Wednesday, April 14, 2010
![Page 27: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/27.jpg)
What is Riak?(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 28: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/28.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 29: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/29.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
key-value storage
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 30: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/30.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
key-value storage
masterless, peer-to-peer replication
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 31: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/31.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
key-value storage
masterless, peer-to-peer replication
consistent hashing
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 32: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/32.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
key-value storage
masterless, peer-to-peer replication
consistent hashing
eventual consistency
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 33: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/33.jpg)
What is Riak?
Based on Amazon’s Dynamo (2007)
key-value storage
masterless, peer-to-peer replication
consistent hashing
eventual consistency
failover - quorums, hinted handoff
(the horizontal scaling bits)
Wednesday, April 14, 2010
![Page 34: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/34.jpg)
“O/RM is the Vietnam of Computer Science.”-- Ted Neward, 2004/6
Wednesday, April 14, 2010
![Page 35: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/35.jpg)
“O/RM is the Vietnam of Computer Science.”-- Ted Neward, 2004/6
slippery slope
Wednesday, April 14, 2010
![Page 36: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/36.jpg)
“O/RM is the Vietnam of Computer Science.”-- Ted Neward, 2004/6
slippery slope diminishing returns
Wednesday, April 14, 2010
![Page 37: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/37.jpg)
Impedance mismatch
Wednesday, April 14, 2010
![Page 38: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/38.jpg)
Impedance mismatch
Relational = predicate logic, truth statements
Wednesday, April 14, 2010
![Page 39: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/39.jpg)
Impedance mismatch
Relational = predicate logic, truth statements
Object = identity, state, behavior, encapsulation
Wednesday, April 14, 2010
![Page 40: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/40.jpg)
Pick your poison
Wednesday, April 14, 2010
![Page 41: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/41.jpg)
Pick your poison
Make the objects fit the database
Wednesday, April 14, 2010
![Page 42: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/42.jpg)
Pick your poison
Make the objects fit the database
Active Record
Wednesday, April 14, 2010
![Page 43: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/43.jpg)
Pick your poison
Make the objects fit the database
Active Record
Make the database fit the objects
Wednesday, April 14, 2010
![Page 44: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/44.jpg)
Pick your poison
Make the objects fit the database
Active Record
Make the database fit the objects
OODBMS, Graph DBs
Wednesday, April 14, 2010
![Page 45: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/45.jpg)
Middle ground
Wednesday, April 14, 2010
![Page 46: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/46.jpg)
Middle ground
Document databases (identity and state)
Wednesday, April 14, 2010
![Page 47: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/47.jpg)
Middle ground
Document databases (identity and state)
No JOINs - denormalized / composed
Wednesday, April 14, 2010
![Page 48: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/48.jpg)
Middle ground
Document databases (identity and state)
No JOINs - denormalized / composed
Loosely structured
Wednesday, April 14, 2010
![Page 49: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/49.jpg)
Middle ground
Document databases (identity and state)
No JOINs - denormalized / composed
Loosely structured
Friendly transport formats, e.g. JSON
Wednesday, April 14, 2010
![Page 50: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/50.jpg)
What is Riak?(the document database bits)
Wednesday, April 14, 2010
![Page 51: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/51.jpg)
What is Riak?
Store your objects as JSON (or any format)
(the document database bits)
Wednesday, April 14, 2010
![Page 52: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/52.jpg)
What is Riak?
Store your objects as JSON (or any format)
Link between objects (like hypertext)
(the document database bits)
Wednesday, April 14, 2010
![Page 53: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/53.jpg)
What is Riak?
Store your objects as JSON (or any format)
Link between objects (like hypertext)
No SQL - query with Javascript Map-Reduce
(the document database bits)
Wednesday, April 14, 2010
![Page 54: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/54.jpg)
“DevOps” - agile infrastructure
Wednesday, April 14, 2010
![Page 55: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/55.jpg)
“DevOps” - agile infrastructureprogramming your infrastructure
Wednesday, April 14, 2010
![Page 56: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/56.jpg)
“DevOps” - agile infrastructureprogramming your infrastructure
rapid “cloud” deployments
Wednesday, April 14, 2010
![Page 57: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/57.jpg)
Befriend your sysadmin
Wednesday, April 14, 2010
![Page 58: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/58.jpg)
Befriend your sysadmin
Integrate with existing infrastructure
Wednesday, April 14, 2010
![Page 59: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/59.jpg)
Befriend your sysadmin
Integrate with existing infrastructure
Reduce the amount of hands-on work
Wednesday, April 14, 2010
![Page 60: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/60.jpg)
Befriend your sysadmin
Integrate with existing infrastructure
Reduce the amount of hands-on work
Have a growth plan
Wednesday, April 14, 2010
![Page 61: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/61.jpg)
What is Riak?(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 62: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/62.jpg)
What is Riak?
Web-shaped storage
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 63: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/63.jpg)
What is Riak?
Web-shaped storage
Store data in its original format
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 64: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/64.jpg)
What is Riak?
Web-shaped storage
Store data in its original format
It’s just HTTP - same techniques apply
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 65: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/65.jpg)
What is Riak?
Web-shaped storage
Store data in its original format
It’s just HTTP - same techniques apply
load balancing, proxy caches, round-robin DNS
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 66: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/66.jpg)
What is Riak?
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
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 67: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/67.jpg)
What is Riak?
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
(the ops-friendly bits)
Wednesday, April 14, 2010
![Page 68: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/68.jpg)
To review, Riak is...
Wednesday, April 14, 2010
![Page 69: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/69.jpg)
To review, Riak is...
Magical Horizontally-Scaling Unicorns
Wednesday, April 14, 2010
![Page 70: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/70.jpg)
To review, Riak is...
Magical Horizontally-Scaling Unicorns
Application-Friendly Rainbows in the Cloud
Wednesday, April 14, 2010
![Page 71: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/71.jpg)
To review, Riak is...
Magical Horizontally-Scaling Unicorns
Application-Friendly Rainbows in the Cloud
Data-Shredding MapReduce Ninjas
Wednesday, April 14, 2010
![Page 72: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/72.jpg)
http://downloads.basho.com/riak/hg clone http://hg.basho.com/riak/
Wednesday, April 14, 2010
![Page 73: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/73.jpg)
gem install ripplegit clone git://github.com/seancribbs/ripple.git
Wednesday, April 14, 2010
![Page 74: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/74.jpg)
CRUD in Riak
Wednesday, April 14, 2010
![Page 75: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/75.jpg)
CRUD in Riak
PUT /riak/bucket/key (C,U) (also POST)
Wednesday, April 14, 2010
![Page 76: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/76.jpg)
CRUD in Riak
PUT /riak/bucket/key (C,U) (also POST)
GET /riak/bucket/key (R)
Wednesday, April 14, 2010
![Page 77: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/77.jpg)
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
![Page 78: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/78.jpg)
CRUD Demo
Wednesday, April 14, 2010
![Page 79: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/79.jpg)
Links
Wednesday, April 14, 2010
![Page 80: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/80.jpg)
Links
One-way, qualified “pointers” to other objects
Wednesday, April 14, 2010
![Page 81: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/81.jpg)
Links
One-way, qualified “pointers” to other objects
“Link” header in HTTP
Wednesday, April 14, 2010
![Page 82: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/82.jpg)
Links
One-way, qualified “pointers” to other objects
“Link” header in HTTP
</riak/bucket/key>; riaktag=”tag”
Wednesday, April 14, 2010
![Page 83: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/83.jpg)
Link-walking
Wednesday, April 14, 2010
![Page 84: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/84.jpg)
Link-walking
GET /riak/bucket/key/[bucket,tag,keep]*
Wednesday, April 14, 2010
![Page 85: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/85.jpg)
Link-walking
GET /riak/bucket/key/[bucket,tag,keep]*
bucket = scope to a bucket
Wednesday, April 14, 2010
![Page 86: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/86.jpg)
Link-walking
GET /riak/bucket/key/[bucket,tag,keep]*
bucket = scope to a bucket
tag = scope to a tag
Wednesday, April 14, 2010
![Page 87: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/87.jpg)
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
![Page 88: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/88.jpg)
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
![Page 89: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/89.jpg)
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
![Page 90: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/90.jpg)
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
![Page 91: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/91.jpg)
Links Demo
Wednesday, April 14, 2010
![Page 92: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/92.jpg)
Riak Map-ReduceI believe I did, Bob.
Wednesday, April 14, 2010
![Page 93: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/93.jpg)
Riak Map-Reduce
Wednesday, April 14, 2010
![Page 94: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/94.jpg)
Riak Map-Reduce
Based on Google’s Map-Reduce idea
Wednesday, April 14, 2010
![Page 95: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/95.jpg)
Riak Map-Reduce
Based on Google’s Map-Reduce idea
Some similarities to Hadoop and CouchDB
Wednesday, April 14, 2010
![Page 96: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/96.jpg)
Riak Map-Reduce
Based on Google’s Map-Reduce idea
Some similarities to Hadoop and CouchDB
High data-locality
Wednesday, April 14, 2010
![Page 97: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/97.jpg)
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
![Page 98: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/98.jpg)
Map-Reduce Terminology
Wednesday, April 14, 2010
![Page 99: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/99.jpg)
Map-Reduce Terminology
Job: a query, composed of inputs and phases
Wednesday, April 14, 2010
![Page 100: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/100.jpg)
Map-Reduce Terminology
Job: a query, composed of inputs and phases
Phase: a single map or reduce function application
Wednesday, April 14, 2010
![Page 101: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/101.jpg)
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
![Page 102: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/102.jpg)
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
![Page 103: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/103.jpg)
Map Phases
Wednesday, April 14, 2010
![Page 104: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/104.jpg)
Map Phases
Inputs are bucket-key pairs (with optional key-specific data)
Wednesday, April 14, 2010
![Page 105: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/105.jpg)
Map Phases
Inputs are bucket-key pairs (with optional key-specific data)
Must return a list
Wednesday, April 14, 2010
![Page 106: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/106.jpg)
Map Phases
Inputs are bucket-key pairs (with optional key-specific data)
Must return a list
Parallel results are aggregated
Wednesday, April 14, 2010
![Page 107: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/107.jpg)
Map Built-ins
Wednesday, April 14, 2010
![Page 108: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/108.jpg)
Map Built-ins
Riak.mapValues
Wednesday, April 14, 2010
![Page 109: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/109.jpg)
Map Built-ins
Riak.mapValues
Riak.mapValuesJson
Wednesday, April 14, 2010
![Page 110: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/110.jpg)
Reduce Phases
Wednesday, April 14, 2010
![Page 111: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/111.jpg)
Reduce Phases
Performed on a single node
Wednesday, April 14, 2010
![Page 112: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/112.jpg)
Reduce Phases
Performed on a single node
Two processes per reduce phase increase parallelism
Wednesday, April 14, 2010
![Page 113: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/113.jpg)
Reduce Phases
Performed on a single node
Two processes per reduce phase increase parallelism
Must return a list
Wednesday, April 14, 2010
![Page 114: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/114.jpg)
Reduce Built-ins
Wednesday, April 14, 2010
![Page 115: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/115.jpg)
Reduce Built-ins
Riak.reduceMin
Wednesday, April 14, 2010
![Page 116: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/116.jpg)
Reduce Built-ins
Riak.reduceMin
Riak.reduceMax
Wednesday, April 14, 2010
![Page 117: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/117.jpg)
Reduce Built-ins
Riak.reduceMin
Riak.reduceMax
Riak.reduceSort
Wednesday, April 14, 2010
![Page 118: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/118.jpg)
Build a M/R Job
Wednesday, April 14, 2010
![Page 119: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/119.jpg)
Build a M/R Job
Specify inputs
Wednesday, April 14, 2010
![Page 120: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/120.jpg)
Build a M/R Job
Specify inputs
bucket/key, bucket/key/key-specific-arg, bucket
Wednesday, April 14, 2010
![Page 121: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/121.jpg)
Build a M/R Job
Specify inputs
bucket/key, bucket/key/key-specific-arg, bucket
Specify phases
Wednesday, April 14, 2010
![Page 122: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/122.jpg)
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
![Page 123: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/123.jpg)
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
![Page 124: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/124.jpg)
Map-Reduce on HTTP
Wednesday, April 14, 2010
![Page 125: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/125.jpg)
Map-Reduce on HTTP
Job is a JSON object
Wednesday, April 14, 2010
![Page 126: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/126.jpg)
Map-Reduce on HTTP
Job is a JSON object
POST /mapred
Wednesday, April 14, 2010
![Page 127: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/127.jpg)
A simple M/R job
{“inputs”: “goog”,
“query”: [{“map”:
{“language”:”javascript”,
“name”: “Riak.mapValuesJson”,
“keep”: true}]}
Wednesday, April 14, 2010
![Page 128: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/128.jpg)
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
![Page 129: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/129.jpg)
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
![Page 130: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/130.jpg)
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
![Page 131: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/131.jpg)
Map-Reduce Demo
Wednesday, April 14, 2010
![Page 132: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/132.jpg)
Ripple
Wednesday, April 14, 2010
![Page 133: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/133.jpg)
Ripple
Document-style persistence (like MongoMapper)
Wednesday, April 14, 2010
![Page 134: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/134.jpg)
Ripple
Document-style persistence (like MongoMapper)
ActiveModel niceties
Wednesday, April 14, 2010
![Page 135: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/135.jpg)
Ripple
Document-style persistence (like MongoMapper)
ActiveModel niceties
Callbacks
Wednesday, April 14, 2010
![Page 136: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/136.jpg)
Ripple
Document-style persistence (like MongoMapper)
ActiveModel niceties
Callbacks
Validations
Wednesday, April 14, 2010
![Page 137: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/137.jpg)
Ripple
Document-style persistence (like MongoMapper)
ActiveModel niceties
Callbacks
Validations
ActionPack compatibility
Wednesday, April 14, 2010
![Page 138: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/138.jpg)
Ripple TODO
Wednesday, April 14, 2010
![Page 139: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/139.jpg)
Ripple TODO
Associations
Wednesday, April 14, 2010
![Page 140: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/140.jpg)
Ripple TODO
Associations
Indexes
Wednesday, April 14, 2010
![Page 141: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/141.jpg)
Ripple TODO
Associations
Indexes
Use a property/method as the key
Wednesday, April 14, 2010
![Page 142: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/142.jpg)
Ripple TODO
Associations
Indexes
Use a property/method as the key
Dynamic finders
Wednesday, April 14, 2010
![Page 143: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/143.jpg)
Ripple TODO
Associations
Indexes
Use a property/method as the key
Dynamic finders
Session/cache stores
Wednesday, April 14, 2010
![Page 144: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/144.jpg)
Ripple Demo
Wednesday, April 14, 2010
![Page 145: Introducing Riak and Ripple](https://reader031.vdocuments.site/reader031/viewer/2022012922/54b760184a7959a23c8b4633/html5/thumbnails/145.jpg)
Questions?
@seancribbs
“seancribbs” on Freenode IRC #riak
http://wiki.basho.com
Wednesday, April 14, 2010