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/365791
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
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
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
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
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
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
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
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