Riak ( http://wiki.basho.com ), a Dynamo-inspired, open-source key/value datastore, was built to scale from a single machine to a 100+ server cluster without driving you or your operations team crazy. This presentation discusses the characteristics of Riak that become important in small, medium, and large clusters.
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Riak - From Small to Large
1. Riak from Small to Large
Strange Loop · October 2010
Rusty Klophaus (@rklophaus)
Basho Technologies
2. Riak is a Dynamo-inspired,
open-sourced, key/value datastore
built to scale predictably and easily.
2
3. Riak is a Dynamo-inspired,
open-sourced, key/value datastore
built to scale predictably and easily.
Your ops guy: calm, relaxed, and wearing a party hat.
3
20. Four Important Things
1. Broad Knowledge
Learn from the past, both DB *and* non-DB worlds.
• VP Technical Services, Akamai
• Senior Architect, Akamai
• Chief of Operations, Snapfish
• Release Manager, Engine Yard
• Bob Ippolito (CTO/CoFounder MochiMedia)
• Dr. Eric Brewer (CAP Theorum)
20
21. Four Important Things
2. Strong Community
Stay in touch with real problems.
Mark Phillips
Basho Community Manager
21
50. Thanks! Questions?
Next Steps
Read more at http://wiki.basho.com
Download binaries from http://downloads.basho.com
Get source code from http://hg.basho.com
Join the public mailing list at riak-users@lists.basho.com
Mailing list archives at http://riak.markmail.org
Thanks!
Rusty Klophaus (@rklophaus)
Mark Phillips (@pharkmillups)
49
54. Connect with Python
# Code is at http://hg.basho.com
import riak
# Connect
client = riak.RiakClient('127.0.0.1', 8098)
53
55. Store Data
mybucket = client.bucket('mybucket')
# Create an object...
obj = mybucket.new('myobject')
obj.set_data({ 'foo' : 1, 'bar' : 2 })
obj.store()
# Read the object...
obj = mybucket.get('myobject')
print obj.get_data()
# Or, open a web browser...
http://127.0.0.1:8098/riak/mybucket/myobject
54
56. Store an Object with Links
bands = client.bucket('bands')
albums = client.bucket('albums')
members = client.bucket('members')
# Store a band, link to album and members...
obj = bands.new('Winger')
.add_link(albums.new('Pull', 1275922).store())
.add_link(albums.new('IV', 542731).store())
.add_link(albums.new('Karma', 200170).store())
.add_link(members.new('Kip Winger').store())
.add_link(members.new('Reb Beach').store())
.add_link(members.new('John Roth').store())
.add_link(members.new('Rod M.').store())
.store()
55
57. Linkwalking
# Get the albums...
albums = obj.link('albums').run()
# Get the songs (assumes data is present)...
songs = obj.link('albums').link('songs').run()
# Get the members...
members = riak.MapReduce(client)
.add('bands', 'Winger')
.link('members')
.run()
56
58. Map/Reduce
# Count the number of sales...
result = obj
.link('albums')
.map("function(v) { return [v.values[0].data]; }")
.reduce("Riak.reduceSum")
.run()
57