hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to...

Post on 16-Sep-2020

0 views 0 download

Transcript of hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to...

fromhandtomouth

Pavlo Baron

pavlo.baron@codecentric.de@pavlobaron

Geek‘sGuide

To The Working Life

Forget backend

Or at least whatyou call a backend

Your application serverwill just slow downyour machines tokeep step with them

Or you will slow downyour incoming trafficto give your applicationserver a chance tobreathe

It's like: order foodat McDonalds, getqueued and receivethe ordered foodthrough mail 3days later

Trying to speed it upis like: order food atMcDonalds, get queued,leave the restaurantwith color pictures ofyour food and wait 3days for its delivery

Every single dataabstraction layer onlyhelps ruin theatmosphere throughheating

Hey, man,you carry around a damnUSS Enterprise in yourpocket

And you can run adamn Babylon 5 in

a cluster

And in the end, it'salways store/update/delete/read/search/process.

Isn't it?

So why drive a clown carwhen you can havea Ferrarifull of these?

Why not just livefrom hand to mouth?

You haz this?

Mobile clients write fromeverywhere, buffer,read occasionally,post-processing completelybehind the scenes, likestatistics etc.

Zoom in!

Immediate, reliable, massivewrites. Analytics andprocessing in a batchafterwards. No need tobe exact to the secondand 100% data complete

Zoom in!

Zoom in!

Buffer

local

ProtoBufs, REST

Round Robin

Web Apps,R,

tools etc.

REST, local Erlang

HTF does it work?

Da core

Da ring

X bit integer space0 <= N <= 2 ^ X

or: 2 x Pi0 <= A <= 2 x Pix(N) = cos(A)y(N) = sin(A)

Da cluster

12 partitions (constant)3 nodes, 4 vnodes each

add node4 nodes, 3 vnodes each

Alternatives:3 nodes, 2 x 5 + 1 x 2 vnodes

container based

Da quorum

V: vnodes holding a keyW: write quorumR: read quorumDW, PW, PR

W > 0.5 * VR + W > V

Key = “foo”# = N, W = 2

N

Insert key(sloppy quorum)

replicate

ok

leave

Add node

copy

copy

leave

leave

copy

Key = “foo”# = N, R = 2

N

Lookup key(sloppy

quorum)

Value = “bar”

leave

Removenode

copy

stableupdates

Da Gossip

RM1Clock table

Replica clock

Update logValueclock

Value

Executed operation table

write RM2

Node 1

Node 2

Node 3

1,0,0

1,2,0

3,2,0

1,3,31,1,0

1,0,1 1,2,2 1,2,3

2,2,0 4,3,3

4,4,3

4,3,4

Da vector clocks

Da MapReduce

map reduce

Node X

Node C

N ="Alice"

map

query ="Alice"

Node A

N =„Alice"

Node B

N ="Alice"

map

hitlist

Da hinted handoff

N: node, G: group including N

node(N) is unavailablereplicate to G orstore data(N) locallyhint handoff for later

node(N) is alivehandoff data to node(N)

Key = “foo”

N

replicate

Key = “foo”, # = N ->handoff hint = true

Replicafails

Replicarecovershandoff

And that's by far not all:

You can search throughindex with data locality.

You can tag objects andquery through 2i.

You can add hooks

You don't even need to storeanything.

Just distribute yourcalculation, search, batch

Have a look at tendita.com

So it's even comfy to loadyour clown carwith these

Thank you

Most images originate fromistockphoto.com

except few ones takenfrom Wikipedia or Flickr (CC)

and product pages/publicly available presentations

or generated through publiconline generators