lambda jam 2013

33
DISTRIBUTED SYSTEMS: ERLANG, RIAK CORE, RIAK PIPE A few clues, a few rants, and a call to action 1 Tuesday, July 9, 13

Upload: macintux

Post on 12-Nov-2014

1.040 views

Category:

Technology


0 download

DESCRIPTION

Slides from my Lambda Jam 2013 talk: Distributed Programming with Erlang, Riak Core, and Riak Pipe

TRANSCRIPT

Page 1: Lambda jam 2013

DISTRIBUTED SYSTEMS: ERLANG, RIAK CORE,

RIAK PIPEA few clues, a few rants, and a call to action

1Tuesday, July 9, 13

Page 2: Lambda jam 2013

ABOUT ME• Technical Evangelist for Basho• @macintux• [email protected]• http://tinyurl.com/jrdlj13

2Tuesday, July 9, 13

Page 3: Lambda jam 2013

ZERG.ERLANGONXEN.COM

3Tuesday, July 9, 13

Page 4: Lambda jam 2013

THOU SHALT LOOK AT ERLANG

John’s first commandment of infrastructure software

4Tuesday, July 9, 13

Page 5: Lambda jam 2013

5Tuesday, July 9, 13

Page 6: Lambda jam 2013

6Tuesday, July 9, 13

Page 7: Lambda jam 2013

The Erlang virtual machine provides fault-tolerance features and a highly scalable architecture while the Erlang programming language keeps the required source code

small and easy to follow.

It’s important to understand that few programming languages can provide real fault-tolerance with scalability.

In fact, I’d say Erlang is roughly alone in this regard.MICHAEL TRUOG

7Tuesday, July 9, 13

Page 8: Lambda jam 2013

WHY DISTRIBUTED PROGRAMMING IS HARD

• Clocks

8Tuesday, July 9, 13

Page 9: Lambda jam 2013

WHY DISTRIBUTED PROGRAMMING IS HARD

• Clocks• Latency

9Tuesday, July 9, 13

Page 10: Lambda jam 2013

WHY DISTRIBUTED PROGRAMMING IS HARD

• Clocks• Latency• Lost messages

10Tuesday, July 9, 13

Page 11: Lambda jam 2013

WHY DISTRIBUTED PROGRAMMING IS HARD

• Clocks• Latency• Lost messages• Servers break

11Tuesday, July 9, 13

Page 12: Lambda jam 2013

12Tuesday, July 9, 13

Page 13: Lambda jam 2013

CAP LIGHTNING TALK

13Tuesday, July 9, 13

Page 14: Lambda jam 2013

14Tuesday, July 9, 13

Page 15: Lambda jam 2013

15Tuesday, July 9, 13

Page 16: Lambda jam 2013

16Tuesday, July 9, 13

Page 17: Lambda jam 2013

17Tuesday, July 9, 13

Page 18: Lambda jam 2013

18Tuesday, July 9, 13

Page 19: Lambda jam 2013

/CAP LIGHTNING TALK/memes

19Tuesday, July 9, 13

Page 20: Lambda jam 2013

• Key/value store

DYNAMO & RIAK

20Tuesday, July 9, 13

Page 21: Lambda jam 2013

• Key/value store

• Consistent hashing

DYNAMO & RIAK

21Tuesday, July 9, 13

Page 22: Lambda jam 2013

• Key/value store

• Consistent hashing

• Granular compute engines

DYNAMO & RIAK

22Tuesday, July 9, 13

Page 23: Lambda jam 2013

• Key/value store

• Consistent hashing

• Granular compute engines

• Replication

DYNAMO & RIAK

23Tuesday, July 9, 13

Page 24: Lambda jam 2013

24Tuesday, July 9, 13

Page 25: Lambda jam 2013

25Tuesday, July 9, 13

Page 26: Lambda jam 2013

The spirit of the cloud is ‘every node can die’, writing the administration software for a cloud expecting the administration nodes to stay alive is hypocritical.

Yet just saying ‘hey the API will be down if you lose the controlling node’ kind of sucks so it comes down having a

distributed system either with stateless nodes and a distributed database or with distributed nodes and a local

database.HEINZ GIES, PROJECT FIFO

26Tuesday, July 9, 13

Page 27: Lambda jam 2013

27Tuesday, July 9, 13

Page 28: Lambda jam 2013

28Tuesday, July 9, 13

Page 29: Lambda jam 2013

RIAK PIPELike UNIX pipes, but not!

29Tuesday, July 9, 13

Page 30: Lambda jam 2013

RIAK PIPE COMPONENTS• Pipeline (client, fittings, sink)

• Fitting (specification of behavior, partitioner)

• Coordinator (one/fitting/cluster)

• Worker process (one/fitting/vnode, implements a behavior)

30Tuesday, July 9, 13

Page 31: Lambda jam 2013

RIAK PIPE PROCESSING1. Client submits a pipeline specification

2. Coordinators are spawned from last to first

3. When input arrives at a vnode, if no worker for that fitting exists yet the appropriate coordinator will be asked for the fitting specification

4. The last fitting sends its output to the sink, which is typically the client

31Tuesday, July 9, 13

Page 32: Lambda jam 2013

RIAK PIPE DEBUGGING• Log and trace messages are optionally sent to the sink

• riak_pipe:status will return a list of fittings; each item is a list of worker details: node ID, state, queue length, idle time, etc

• Fittings can define a validator function to be invoked on inputs before processing

• Intermediate outputs can be forwarded directly to sink

32Tuesday, July 9, 13

Page 33: Lambda jam 2013

THE END IS NIGH• Riak 1.4• RICON• Meetups

33Tuesday, July 9, 13