SlideShare a Scribd company logo
1 of 52
Download to read offline
Rusty Klophaus (@rklophaus)
BashoTechnologies
Masterless Distributed
Computing with Riak Core
Erlang User Conference
Stockholm, Sweden · November 2010
Monday, November 22, 2010
BashoTechnologies
2
About BashoTechnologies
• Offices in:
• Cambridge, Massachusetts
• San Francisco, California
• Distributed company
• ~20 people
• Riak KV and Riak Search (both Open Source)
• SLA-based Support and Enterprise Software ($)
• Other Open Source Erlang developed by Basho:
• Webmachine, Rebar, Bitcask, Erlang_JS, Basho Bench
Monday, November 22, 2010
Riak KV and Riak Search
3
Riak KV
Key/Value Datastore
Map/Reduce, Lightweight Data Relations, Client APIs
Riak Search
Full-text search and indexing engine
Near Realtime Indexing, Riak KV Integration, Solr Support.
Common Properties
Both are distributed, scalable, failure-tolerant applications.
Both based on Amazon’s Dynamo Architecture.
Monday, November 22, 2010
Riak
KV
Riak
Search
Riak
Core
The Common Parts are called Riak Core
Monday, November 22, 2010
Riak
KV
Riak
Search
Riak
Core
The Common Parts are called Riak Core
Distribution / Scaling /
Failure-Tolerance Code
Monday, November 22, 2010
Riak Core is an
Open Source Erlang library
that helps you build
distributed, scalable, failure-tolerant
applications using a
Dynamo-style architecture.
6
Monday, November 22, 2010
“We Generalized the
Dynamo Architecture and
Open-Sourced the Bits.”
7
Monday, November 22, 2010
What Areas are Covered?
Amazon’s Dynamo Paper highlighted to
show parts covered in Riak Core.
Monday, November 22, 2010
Distributed, scalable, failure-tolerant.
9
Monday, November 22, 2010
Distributed, scalable, failure-tolerant.
No central coordinator.
Easy to setup/operate.
10
Monday, November 22, 2010
Distributed, scalable, failure-tolerant.
Horizontally scalable;
add commodity hardware
to get more X.
11
Monday, November 22, 2010
Distributed, scalable, failure-tolerant.
Always available.
No single point of failure.
Self-healing.
12
Monday, November 22, 2010
Wait, doesn’t *Erlang* let you build
distributed, scalable, failure-tolerant
applications?
13
Monday, November 22, 2010
Client
Service A Service B
Resource D
Service C
Queue E
Erlang makes it easy to connect the
components of your application.
Monday, November 22, 2010
Service
Node A
Node E
Node I
Node M
Node B
Node F
Node J
Node N
Node C
Node G
Node K
Node O
Node D
Node H
Node L
. . .
Riak Core helps you build a service that
harnesses the power of many nodes.
Monday, November 22, 2010
How does Riak Core work?
16
Monday, November 22, 2010
A Simple Interface...
Command ObjectName, Payload
Send commands, get responses.
How do we route the commands
to physical machines?
Monday, November 22, 2010
Hash the Object Name
Command ObjectName, Payload
SHA1(ObjName), Payload
0 to 2^160
Monday, November 22, 2010
A Naive Approach
Command ObjectName, Payload
SHA1(ObjName), Payload
Node A Node B Node C Node D
Monday, November 22, 2010
A Naive Approach
Command
SHA1(ObjName), Payload
Node A Node B Node C Node D Node E
ObjectName, Payload
Existing routes become invalid
when you add/remove nodes.
Monday, November 22, 2010
"All problems in computer
science can be solved by
another level of indirection."
- David Wheeler
21
Monday, November 22, 2010
Routing with Consistent Hashing
Command ObjectName, Payload
SHA1(ObjName), Payload
VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7
Node A Node B Node C Node D
Monday, November 22, 2010
Adding a Node
Command ObjectName, Payload
SHA1(ObjName), Payload
VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7
Node A Node B Node C Node D Node E
Monday, November 22, 2010
Removing a Node
Command ObjectName, Payload
SHA1(ObjName), Payload
VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7
Node A Node B Node C Node D Node E
Monday, November 22, 2010
The Ring
Hash Location
Monday, November 22, 2010
Writing Replicas (NValue)
Locations when N=3
Monday, November 22, 2010
Routing Around Failures
Locations when N=3
and node 0 is down.
X
Monday, November 22, 2010
The Preflist
Preflist
Monday, November 22, 2010
Location of the Routing Layer
29
Monday, November 22, 2010
Router in the Middle Leads to SPOF
Client Client Client
Router
VNode
0
Node A Node B Node C Node D Node E
VNode
1
VNode
3
VNode
4
VNode
2
VNode
5
VNode
6
VNode
7
Monday, November 22, 2010
Riak Core - Router on Each Node
Client Client Client
Router Router Router RouterRouter
VNode
0
Node A Node B Node C Node D Node E
VNode
1
VNode
3
VNode
4
VNode
2
VNode
5
VNode
6
VNode
7
Monday, November 22, 2010
Eventually - Router in the Client
Client Client Client
VNode
0
Node A Node B Node C Node D Node E
VNode
1
VNode
3
VNode
4
VNode
2
VNode
5
VNode
6
VNode
7
Router RouterRouter
Why isn’t this done yet?
Time and complexity.
Monday, November 22, 2010
How DoThe Routers Reach Agreement?
Router Router Router RouterRouter
VNode
0
Node A Node B Node C Node D Node E
VNode
1
VNode
3
VNode
4
VNode
2
VNode
5
VNode
6
VNode
7
Monday, November 22, 2010
The Nodes GossipTheir WorldView
Local
Ring State
Incoming
Ring State
Are rings equivalent?
Strictly descendent?
Or different?
Monday, November 22, 2010
Not Mentioned
Vector Clocks
MerkleTrees
Bloom Filters
35
Monday, November 22, 2010
Building an Application
with Riak Core
36
Monday, November 22, 2010
Building an Application on Riak Core?
Two things to think about:
37
The Command Set
Command = ObjectName, Payload
The commands/requests/operations that you will send
through the system.
TheVNode Module
The callback module that will receive the commands.
Monday, November 22, 2010
Writing aVNode Module
38
Startup/Shutdown
init([Partition]) ->
{ok, State}
terminate(State) ->
ok
Receive Incoming Commands
handle_command(Cmd, Sender, State) ->
{noreply, State1} | {reply, Reply, State1}
handle_handoff_command(Cmd, Sender, State) ->
{noreply, State1} | {reply, ok, State1}
Monday, November 22, 2010
Writing aVNode Module
39
Send and Receive Handoff Data
handoff_starting(Node, State) ->
{Bool, State1}
encode_handoff_data(Data, State) ->
<<Binary>>.
handle_handoff_data(Data, Sender, State) ->
{reply, ok, State1}
handoff_finished(Node, State) ->
{ok, State1}
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
40
application:start(riak_core).
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
41
Supervise vnode processes.
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
42
Start, coordinate, and supervise handoff.
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
43
Maintain cluster membership information.
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
44
Monitor node liveness,
broadcast to registered modules.
Monday, November 22, 2010
Start the riak_core application
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
45
Send ring information to other nodes.
Reconcile different views of the cluster.
Rebalance cluster when nodes join or leave.
Monday, November 22, 2010
In your application...
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
46
Start the vnodes for your application.
Master = {
riak_X_vnode_master, {
riak_core_vnode_master, start_link, [riak_X_vnode]
},
permanent, 5000, worker, [riak_core_vnode_master]
},
{ok, { {one_for_one, 5, 10}, [Master]} }.
Monday, November 22, 2010
In your application...
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
47
Tell riak_core that your application
is ready to receive requests.
riak_core:register_vnode_module(riak_X_vnode),
riak_core_node_watcher:service_up(riak_X,
self())
Monday, November 22, 2010
In your application...
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
riak_core
riak_core_vnode_sup riak_core_handoff_*
riak_core_ring_*
riak_core_node_*
riak_core_gossip_*
X_vnode
. . .
X_vnode
X_vnode
48
Join to an existing node in the cluster.
riak_core_gossip:send_ring(ClusterNode,
node())
Monday, November 22, 2010
Start Sending Commands
49
# Figure out the preflist...
{_Verb, ObjName, _Payload} = Command,
PrefList = riak_core_apl:get_apl(ObjName,
NVal,
riak_X),
# Send the command...
riak_core_vnode_master:command(PrefList,
Command,
riak_X_vnode_master)
Monday, November 22, 2010
Review
Riak KV
Open Source Key/Value datastore.
Riak Search
Full-text, near real-time search engine based on Riak Core.
Riak Core
Open Source Erlang library that helps you build distributed,
scalable, failure-tolerant applications using a Dynamo-style
architecture.
50
Monday, November 22, 2010
Thanks! Questions?
Learn More
http://wiki.basho.com
Read Amazon’s Dynamo Paper
Get the Code
http://github.com/basho/riak_core
Get inTouch
rusty@basho.com on Email
@rklophaus onTwitter
51
Monday, November 22, 2010
END
Monday, November 22, 2010

More Related Content

What's hot

Knative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftKnative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftChris Suszyński
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatAmazon Web Services
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and HowSneha Inguva
 
Real-Time Stock Market Analysis using Spark Streaming
 Real-Time Stock Market Analysis using Spark Streaming Real-Time Stock Market Analysis using Spark Streaming
Real-Time Stock Market Analysis using Spark StreamingSigmoid
 
Managing 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with AmbariManaging 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with AmbariDataWorks Summit
 
containerd the universal container runtime
containerd the universal container runtimecontainerd the universal container runtime
containerd the universal container runtimeDocker, Inc.
 
Podman Overview and internals.pdf
Podman Overview and internals.pdfPodman Overview and internals.pdf
Podman Overview and internals.pdfSaim Safder
 
Introduction to openshift
Introduction to openshiftIntroduction to openshift
Introduction to openshiftMamathaBusi
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demoOpsta
 
Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!Nico Krijnen
 
Introduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseIntroduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseAbhijeet Shekhar
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and DockerFayçal Bziou
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetesKrishna-Kumar
 

What's hot (20)

Knative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftKnative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and Openshift
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Real-Time Stock Market Analysis using Spark Streaming
 Real-Time Stock Market Analysis using Spark Streaming Real-Time Stock Market Analysis using Spark Streaming
Real-Time Stock Market Analysis using Spark Streaming
 
Managing 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with AmbariManaging 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with Ambari
 
Node Labels in YARN
Node Labels in YARNNode Labels in YARN
Node Labels in YARN
 
OpenShift Introduction
OpenShift IntroductionOpenShift Introduction
OpenShift Introduction
 
containerd the universal container runtime
containerd the universal container runtimecontainerd the universal container runtime
containerd the universal container runtime
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Podman Overview and internals.pdf
Podman Overview and internals.pdfPodman Overview and internals.pdf
Podman Overview and internals.pdf
 
Introduction to openshift
Introduction to openshiftIntroduction to openshift
Introduction to openshift
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demo
 
CRI, OCI, and CRI-O
CRI, OCI, and CRI-OCRI, OCI, and CRI-O
CRI, OCI, and CRI-O
 
Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!
 
Introduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseIntroduction of Redis as NoSQL Database
Introduction of Redis as NoSQL Database
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
 

Similar to Masterless Distributed Computing with Riak Core

Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeDamien Garros
 
Atom The Redis Streams-Powered Microservices SDK: Dan Pipemazo
Atom The Redis Streams-Powered Microservices SDK: Dan PipemazoAtom The Redis Streams-Powered Microservices SDK: Dan Pipemazo
Atom The Redis Streams-Powered Microservices SDK: Dan PipemazoRedis Labs
 
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...Marcin Bielak
 
SDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesSDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesDiego Kreutz
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTStéphanie Roger
 
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...Naoto Gohko
 
Banog meetup August 30th, network device property as code
Banog meetup August 30th, network device property as codeBanog meetup August 30th, network device property as code
Banog meetup August 30th, network device property as codeDamien Garros
 
Knot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetKnot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetTomasz Michalak
 
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...Cloud Native Day Tel Aviv
 
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis
 
Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?Roberto Franchini
 
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」Sho Shimizu
 
Considerations for using NoSQL technology on your next IT project - Akmal Cha...
Considerations for using NoSQL technology on your next IT project - Akmal Cha...Considerations for using NoSQL technology on your next IT project - Akmal Cha...
Considerations for using NoSQL technology on your next IT project - Akmal Cha...BCS Data Management Specialist Group
 
Why we need internet of things on Node.js
Why we need internet of things on Node.jsWhy we need internet of things on Node.js
Why we need internet of things on Node.jsIndeema Software Inc.
 
Know Your Competitor - Oracle 10g Express Edition
Know Your Competitor - Oracle 10g Express EditionKnow Your Competitor - Oracle 10g Express Edition
Know Your Competitor - Oracle 10g Express EditionRonald Bradford
 
Red Hat OpenStack - Open Cloud Infrastructure
Red Hat OpenStack - Open Cloud InfrastructureRed Hat OpenStack - Open Cloud Infrastructure
Red Hat OpenStack - Open Cloud InfrastructureAlex Baretto
 
Webinar about Spring Data Neo4j 4
Webinar about Spring Data Neo4j 4Webinar about Spring Data Neo4j 4
Webinar about Spring Data Neo4j 4GraphAware
 

Similar to Masterless Distributed Computing with Riak Core (20)

Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Atom The Redis Streams-Powered Microservices SDK: Dan Pipemazo
Atom The Redis Streams-Powered Microservices SDK: Dan PipemazoAtom The Redis Streams-Powered Microservices SDK: Dan Pipemazo
Atom The Redis Streams-Powered Microservices SDK: Dan Pipemazo
 
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...
Let's build a robot with ROS - Internet of Things, Hardware & Robotics meetup...
 
SDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesSDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunities
 
Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
 
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...
OpenStack cloud for ConoHa, Z.com and GMO AppsCloud in okinawa opendays 2015 ...
 
Banog meetup August 30th, network device property as code
Banog meetup August 30th, network device property as codeBanog meetup August 30th, network device property as code
Banog meetup August 30th, network device property as code
 
Knot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetKnot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meet
 
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...
OpenDaylight Netvirt and Neutron - Mike Kolesnik, Josh Hershberg - OpenStack ...
 
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014
 
Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?Where are yours vertexes and what are they talking about?
Where are yours vertexes and what are they talking about?
 
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」
Openflow勉強会 「OpenFlowコントローラを取り巻く状況とその実装」
 
Considerations for using NoSQL technology on your next IT project - Akmal Cha...
Considerations for using NoSQL technology on your next IT project - Akmal Cha...Considerations for using NoSQL technology on your next IT project - Akmal Cha...
Considerations for using NoSQL technology on your next IT project - Akmal Cha...
 
Why we need internet of things on Node.js
Why we need internet of things on Node.jsWhy we need internet of things on Node.js
Why we need internet of things on Node.js
 
NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
Know Your Competitor - Oracle 10g Express Edition
Know Your Competitor - Oracle 10g Express EditionKnow Your Competitor - Oracle 10g Express Edition
Know Your Competitor - Oracle 10g Express Edition
 
Red Hat OpenStack - Open Cloud Infrastructure
Red Hat OpenStack - Open Cloud InfrastructureRed Hat OpenStack - Open Cloud Infrastructure
Red Hat OpenStack - Open Cloud Infrastructure
 
Webinar about Spring Data Neo4j 4
Webinar about Spring Data Neo4j 4Webinar about Spring Data Neo4j 4
Webinar about Spring Data Neo4j 4
 

More from Rusty Klophaus

Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangRusty Klophaus
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleRusty Klophaus
 
Querying Riak Just Got Easier - Introducing Secondary Indices
Querying Riak Just Got Easier - Introducing Secondary IndicesQuerying Riak Just Got Easier - Introducing Secondary Indices
Querying Riak Just Got Easier - Introducing Secondary IndicesRusty Klophaus
 
Riak - From Small to Large - StrangeLoop
Riak - From Small to Large - StrangeLoopRiak - From Small to Large - StrangeLoop
Riak - From Small to Large - StrangeLoopRusty Klophaus
 
Riak - From Small to Large
Riak - From Small to LargeRiak - From Small to Large
Riak - From Small to LargeRusty Klophaus
 
Riak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRiak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRusty Klophaus
 
Riak Search - Erlang Factory London 2010
Riak Search - Erlang Factory London 2010Riak Search - Erlang Factory London 2010
Riak Search - Erlang Factory London 2010Rusty Klophaus
 
Riak Search - Berlin Buzzwords 2010
Riak Search - Berlin Buzzwords 2010Riak Search - Berlin Buzzwords 2010
Riak Search - Berlin Buzzwords 2010Rusty Klophaus
 
Riak from Small to Large
Riak from Small to LargeRiak from Small to Large
Riak from Small to LargeRusty Klophaus
 
Getting Started with Riak - NoSQL Live 2010 - Boston
Getting Started with Riak - NoSQL Live 2010 - BostonGetting Started with Riak - NoSQL Live 2010 - Boston
Getting Started with Riak - NoSQL Live 2010 - BostonRusty Klophaus
 

More from Rusty Klophaus (10)

Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
Winning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test CycleWinning the Erlang Edit•Build•Test Cycle
Winning the Erlang Edit•Build•Test Cycle
 
Querying Riak Just Got Easier - Introducing Secondary Indices
Querying Riak Just Got Easier - Introducing Secondary IndicesQuerying Riak Just Got Easier - Introducing Secondary Indices
Querying Riak Just Got Easier - Introducing Secondary Indices
 
Riak - From Small to Large - StrangeLoop
Riak - From Small to Large - StrangeLoopRiak - From Small to Large - StrangeLoop
Riak - From Small to Large - StrangeLoop
 
Riak - From Small to Large
Riak - From Small to LargeRiak - From Small to Large
Riak - From Small to Large
 
Riak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared StateRiak Core: Building Distributed Applications Without Shared State
Riak Core: Building Distributed Applications Without Shared State
 
Riak Search - Erlang Factory London 2010
Riak Search - Erlang Factory London 2010Riak Search - Erlang Factory London 2010
Riak Search - Erlang Factory London 2010
 
Riak Search - Berlin Buzzwords 2010
Riak Search - Berlin Buzzwords 2010Riak Search - Berlin Buzzwords 2010
Riak Search - Berlin Buzzwords 2010
 
Riak from Small to Large
Riak from Small to LargeRiak from Small to Large
Riak from Small to Large
 
Getting Started with Riak - NoSQL Live 2010 - Boston
Getting Started with Riak - NoSQL Live 2010 - BostonGetting Started with Riak - NoSQL Live 2010 - Boston
Getting Started with Riak - NoSQL Live 2010 - Boston
 

Recently uploaded

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Masterless Distributed Computing with Riak Core

  • 1. Rusty Klophaus (@rklophaus) BashoTechnologies Masterless Distributed Computing with Riak Core Erlang User Conference Stockholm, Sweden · November 2010 Monday, November 22, 2010
  • 2. BashoTechnologies 2 About BashoTechnologies • Offices in: • Cambridge, Massachusetts • San Francisco, California • Distributed company • ~20 people • Riak KV and Riak Search (both Open Source) • SLA-based Support and Enterprise Software ($) • Other Open Source Erlang developed by Basho: • Webmachine, Rebar, Bitcask, Erlang_JS, Basho Bench Monday, November 22, 2010
  • 3. Riak KV and Riak Search 3 Riak KV Key/Value Datastore Map/Reduce, Lightweight Data Relations, Client APIs Riak Search Full-text search and indexing engine Near Realtime Indexing, Riak KV Integration, Solr Support. Common Properties Both are distributed, scalable, failure-tolerant applications. Both based on Amazon’s Dynamo Architecture. Monday, November 22, 2010
  • 4. Riak KV Riak Search Riak Core The Common Parts are called Riak Core Monday, November 22, 2010
  • 5. Riak KV Riak Search Riak Core The Common Parts are called Riak Core Distribution / Scaling / Failure-Tolerance Code Monday, November 22, 2010
  • 6. Riak Core is an Open Source Erlang library that helps you build distributed, scalable, failure-tolerant applications using a Dynamo-style architecture. 6 Monday, November 22, 2010
  • 7. “We Generalized the Dynamo Architecture and Open-Sourced the Bits.” 7 Monday, November 22, 2010
  • 8. What Areas are Covered? Amazon’s Dynamo Paper highlighted to show parts covered in Riak Core. Monday, November 22, 2010
  • 10. Distributed, scalable, failure-tolerant. No central coordinator. Easy to setup/operate. 10 Monday, November 22, 2010
  • 11. Distributed, scalable, failure-tolerant. Horizontally scalable; add commodity hardware to get more X. 11 Monday, November 22, 2010
  • 12. Distributed, scalable, failure-tolerant. Always available. No single point of failure. Self-healing. 12 Monday, November 22, 2010
  • 13. Wait, doesn’t *Erlang* let you build distributed, scalable, failure-tolerant applications? 13 Monday, November 22, 2010
  • 14. Client Service A Service B Resource D Service C Queue E Erlang makes it easy to connect the components of your application. Monday, November 22, 2010
  • 15. Service Node A Node E Node I Node M Node B Node F Node J Node N Node C Node G Node K Node O Node D Node H Node L . . . Riak Core helps you build a service that harnesses the power of many nodes. Monday, November 22, 2010
  • 16. How does Riak Core work? 16 Monday, November 22, 2010
  • 17. A Simple Interface... Command ObjectName, Payload Send commands, get responses. How do we route the commands to physical machines? Monday, November 22, 2010
  • 18. Hash the Object Name Command ObjectName, Payload SHA1(ObjName), Payload 0 to 2^160 Monday, November 22, 2010
  • 19. A Naive Approach Command ObjectName, Payload SHA1(ObjName), Payload Node A Node B Node C Node D Monday, November 22, 2010
  • 20. A Naive Approach Command SHA1(ObjName), Payload Node A Node B Node C Node D Node E ObjectName, Payload Existing routes become invalid when you add/remove nodes. Monday, November 22, 2010
  • 21. "All problems in computer science can be solved by another level of indirection." - David Wheeler 21 Monday, November 22, 2010
  • 22. Routing with Consistent Hashing Command ObjectName, Payload SHA1(ObjName), Payload VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7 Node A Node B Node C Node D Monday, November 22, 2010
  • 23. Adding a Node Command ObjectName, Payload SHA1(ObjName), Payload VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7 Node A Node B Node C Node D Node E Monday, November 22, 2010
  • 24. Removing a Node Command ObjectName, Payload SHA1(ObjName), Payload VNode 0 VNode 1 VNode 2 VNode 3 VNode 4 VNode 5 VNode 6 VNode 7 Node A Node B Node C Node D Node E Monday, November 22, 2010
  • 25. The Ring Hash Location Monday, November 22, 2010
  • 26. Writing Replicas (NValue) Locations when N=3 Monday, November 22, 2010
  • 27. Routing Around Failures Locations when N=3 and node 0 is down. X Monday, November 22, 2010
  • 29. Location of the Routing Layer 29 Monday, November 22, 2010
  • 30. Router in the Middle Leads to SPOF Client Client Client Router VNode 0 Node A Node B Node C Node D Node E VNode 1 VNode 3 VNode 4 VNode 2 VNode 5 VNode 6 VNode 7 Monday, November 22, 2010
  • 31. Riak Core - Router on Each Node Client Client Client Router Router Router RouterRouter VNode 0 Node A Node B Node C Node D Node E VNode 1 VNode 3 VNode 4 VNode 2 VNode 5 VNode 6 VNode 7 Monday, November 22, 2010
  • 32. Eventually - Router in the Client Client Client Client VNode 0 Node A Node B Node C Node D Node E VNode 1 VNode 3 VNode 4 VNode 2 VNode 5 VNode 6 VNode 7 Router RouterRouter Why isn’t this done yet? Time and complexity. Monday, November 22, 2010
  • 33. How DoThe Routers Reach Agreement? Router Router Router RouterRouter VNode 0 Node A Node B Node C Node D Node E VNode 1 VNode 3 VNode 4 VNode 2 VNode 5 VNode 6 VNode 7 Monday, November 22, 2010
  • 34. The Nodes GossipTheir WorldView Local Ring State Incoming Ring State Are rings equivalent? Strictly descendent? Or different? Monday, November 22, 2010
  • 35. Not Mentioned Vector Clocks MerkleTrees Bloom Filters 35 Monday, November 22, 2010
  • 36. Building an Application with Riak Core 36 Monday, November 22, 2010
  • 37. Building an Application on Riak Core? Two things to think about: 37 The Command Set Command = ObjectName, Payload The commands/requests/operations that you will send through the system. TheVNode Module The callback module that will receive the commands. Monday, November 22, 2010
  • 38. Writing aVNode Module 38 Startup/Shutdown init([Partition]) -> {ok, State} terminate(State) -> ok Receive Incoming Commands handle_command(Cmd, Sender, State) -> {noreply, State1} | {reply, Reply, State1} handle_handoff_command(Cmd, Sender, State) -> {noreply, State1} | {reply, ok, State1} Monday, November 22, 2010
  • 39. Writing aVNode Module 39 Send and Receive Handoff Data handoff_starting(Node, State) -> {Bool, State1} encode_handoff_data(Data, State) -> <<Binary>>. handle_handoff_data(Data, Sender, State) -> {reply, ok, State1} handoff_finished(Node, State) -> {ok, State1} Monday, November 22, 2010
  • 40. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 40 application:start(riak_core). Monday, November 22, 2010
  • 41. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 41 Supervise vnode processes. Monday, November 22, 2010
  • 42. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 42 Start, coordinate, and supervise handoff. Monday, November 22, 2010
  • 43. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 43 Maintain cluster membership information. Monday, November 22, 2010
  • 44. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 44 Monitor node liveness, broadcast to registered modules. Monday, November 22, 2010
  • 45. Start the riak_core application riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 45 Send ring information to other nodes. Reconcile different views of the cluster. Rebalance cluster when nodes join or leave. Monday, November 22, 2010
  • 46. In your application... riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 46 Start the vnodes for your application. Master = { riak_X_vnode_master, { riak_core_vnode_master, start_link, [riak_X_vnode] }, permanent, 5000, worker, [riak_core_vnode_master] }, {ok, { {one_for_one, 5, 10}, [Master]} }. Monday, November 22, 2010
  • 47. In your application... riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 47 Tell riak_core that your application is ready to receive requests. riak_core:register_vnode_module(riak_X_vnode), riak_core_node_watcher:service_up(riak_X, self()) Monday, November 22, 2010
  • 48. In your application... riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode riak_core riak_core_vnode_sup riak_core_handoff_* riak_core_ring_* riak_core_node_* riak_core_gossip_* X_vnode . . . X_vnode X_vnode 48 Join to an existing node in the cluster. riak_core_gossip:send_ring(ClusterNode, node()) Monday, November 22, 2010
  • 49. Start Sending Commands 49 # Figure out the preflist... {_Verb, ObjName, _Payload} = Command, PrefList = riak_core_apl:get_apl(ObjName, NVal, riak_X), # Send the command... riak_core_vnode_master:command(PrefList, Command, riak_X_vnode_master) Monday, November 22, 2010
  • 50. Review Riak KV Open Source Key/Value datastore. Riak Search Full-text, near real-time search engine based on Riak Core. Riak Core Open Source Erlang library that helps you build distributed, scalable, failure-tolerant applications using a Dynamo-style architecture. 50 Monday, November 22, 2010
  • 51. Thanks! Questions? Learn More http://wiki.basho.com Read Amazon’s Dynamo Paper Get the Code http://github.com/basho/riak_core Get inTouch rusty@basho.com on Email @rklophaus onTwitter 51 Monday, November 22, 2010