A PEEK INSIDE RIAK
Steve Vinoski
Basho Technologies
Cambridge, MA USA http://basho.com @stevevinoski
vinoski@ieee.org http://steve.vinoski.net/
1 Friday, October 18, 13
A PEEK INSIDE RIAK Steve Vinoski Basho Technologies Cambridge, MA - - PowerPoint PPT Presentation
A PEEK INSIDE RIAK Steve Vinoski Basho Technologies Cambridge, MA USA http://basho.com @stevevinoski vinoski@ieee.org http://steve.vinoski.net/ Friday, October 18, 13 1 Riak A distributed highly available eventually consistent highly
Cambridge, MA USA http://basho.com @stevevinoski
vinoski@ieee.org http://steve.vinoski.net/
1 Friday, October 18, 13
highly scalable open source key-value database written primarily in Erlang.
2 Friday, October 18, 13
Basho uses Erlang: http://basho.com/erlang-at-basho-five-years-later/
3 Friday, October 18, 13
docs.basho.com/riak/latest/references/dynamo/
text search
4 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
5 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
6 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
7 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
8 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV
image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
9 Friday, October 18, 13
node 1 node 2
10 Friday, October 18, 13
data across the cluster
number of nodes changes
hotspots
node 1 node 2
11 Friday, October 18, 13
nodes" or vnodes (default 64)
multiple vnodes
node 1 node 2
12 Friday, October 18, 13
node 1 node 2
13 Friday, October 18, 13
node 1 node 2
14 Friday, October 18, 13
per bucket)
for a successful read (can be specified per-request)
needed for a successful write (can be specified per- request)
15 Friday, October 18, 13
for details see http://docs.basho.com/riak/latest/dev/advanced/cap-controls/
node 1 node 2
16 Friday, October 18, 13
17 Friday, October 18, 13
18 Friday, October 18, 13
19 Friday, October 18, 13
20 Friday, October 18, 13
21 Friday, October 18, 13
22 Friday, October 18, 13
slaves
gossip protocol
23 Friday, October 18, 13
supporting multiple nodes for reliability
about every other node
24 Friday, October 18, 13
repository clone (git://github.com/basho/riak.git)
dev3 running in a cluster, nothing on the 4th node yet
as just a plain distributed erlang node
node 1 node 2
25 Friday, October 18, 13
26 Friday, October 18, 13
27 Friday, October 18, 13
28 Friday, October 18, 13
29 Friday, October 18, 13
30 Friday, October 18, 13
node 1 node 2
liveness
easy to set up a cluster
about 150 nodes, work underway to make it scale larger
31 Friday, October 18, 13
has claimed
state to other randomly chosen nodes
ring state to specific nodes
32 Friday, October 18, 13
Bitcask eLevelDB Memory Multi Riak API Riak Clients
hashing
(vnodes)
33 Friday, October 18, 13
34 Friday, October 18, 13
vnode
lightweight processes
35 Friday, October 18, 13
via asynchronous update
stale values
36 Friday, October 18, 13
cluster protocols
with protocol implementations
each other while interacting
process/node dies, great for aborting failed interactions
37 Friday, October 18, 13
patterns for concurrent, distributed, fault-tolerant Erlang apps
38 Friday, October 18, 13
OO terms, providing:
upgrade, tracing, process management, etc.
39 Friday, October 18, 13
40 Friday, October 18, 13
41 Friday, October 18, 13
module
async
42 Friday, October 18, 13
43 Friday, October 18, 13
the riak_kv_backend behavior expects
plan to cover a set of vnodes, for example for secondary index queries or listing buckets
vnodes
44 Friday, October 18, 13
45 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
46 Friday, October 18, 13
Erlang Riak Core Bitcask eLevelDB Memory Multi Riak Pipe Riak API Riak PB Riak Clients Erlang Java Ruby C/C++ Python .NET PHP Go Nodejs More.. Yokozuna Webmachine HTTP Riak KV
image courtesy of Eric Redmond, "A Little Riak Book" https://github.com/coderoshi/little_riak_book/
47 Friday, October 18, 13
libraries into the VM
facilities via drivers
(NIFs)
48 Friday, October 18, 13
library, overlaying its Erlang functions with C/C++ replacements
49 Friday, October 18, 13
50 Friday, October 18, 13
C/C++ and Erlang
(threads, mutexes, cond vars, etc.)
51 Friday, October 18, 13
52 Friday, October 18, 13
and teardown, etc.
53 Friday, October 18, 13
John Hughes (a co-inventor of Haskell)
shrinks the testcase to a minimum for easier debugging
and interactions
54 Friday, October 18, 13
55 Friday, October 18, 13
notify about potential out-of-memory conditions
56 Friday, October 18, 13
57 Friday, October 18, 13
production systems to help customers
58 Friday, October 18, 13
knowledge of Erlang VM internals
language runtimes
59 Friday, October 18, 13
http://littleriakbook.com
http://riakhandbook.com
http://pragprog.com/book/rwdata/seven-databases-in-seven-weeks
60 Friday, October 18, 13
http://docs.basho.com
http://basho.com/blog/
https://github.com/basho https://github.com/basho-labs
61 Friday, October 18, 13
62 Friday, October 18, 13