![Page 1: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/1.jpg)
fromhandtomouth
![Page 3: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/3.jpg)
Forget backend
![Page 4: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/4.jpg)
Or at least whatyou call a backend
![Page 5: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/5.jpg)
Your application serverwill just slow downyour machines tokeep step with them
![Page 6: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/6.jpg)
Or you will slow downyour incoming trafficto give your applicationserver a chance tobreathe
![Page 7: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/7.jpg)
It's like: order foodat McDonalds, getqueued and receivethe ordered foodthrough mail 3days later
![Page 8: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/8.jpg)
Trying to speed it upis like: order food atMcDonalds, get queued,leave the restaurantwith color pictures ofyour food and wait 3days for its delivery
![Page 9: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/9.jpg)
Every single dataabstraction layer onlyhelps ruin theatmosphere throughheating
![Page 10: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/10.jpg)
Hey, man,you carry around a damnUSS Enterprise in yourpocket
And you can run adamn Babylon 5 in
a cluster
![Page 11: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/11.jpg)
And in the end, it'salways store/update/delete/read/search/process.
Isn't it?
![Page 12: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/12.jpg)
So why drive a clown carwhen you can havea Ferrarifull of these?
![Page 13: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/13.jpg)
Why not just livefrom hand to mouth?
![Page 14: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/14.jpg)
You haz this?
Mobile clients write fromeverywhere, buffer,read occasionally,post-processing completelybehind the scenes, likestatistics etc.
![Page 15: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/15.jpg)
Zoom in!
Immediate, reliable, massivewrites. Analytics andprocessing in a batchafterwards. No need tobe exact to the secondand 100% data complete
![Page 16: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/16.jpg)
Zoom in!
![Page 17: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/17.jpg)
Zoom in!
Buffer
local
ProtoBufs, REST
Round Robin
Web Apps,R,
tools etc.
REST, local Erlang
![Page 18: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/18.jpg)
HTF does it work?
![Page 19: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/19.jpg)
Da core
![Page 20: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/20.jpg)
Da ring
X bit integer space0 <= N <= 2 ^ X
or: 2 x Pi0 <= A <= 2 x Pix(N) = cos(A)y(N) = sin(A)
![Page 21: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/21.jpg)
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
![Page 22: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/22.jpg)
Da quorum
V: vnodes holding a keyW: write quorumR: read quorumDW, PW, PR
W > 0.5 * VR + W > V
![Page 23: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/23.jpg)
Key = “foo”# = N, W = 2
N
Insert key(sloppy quorum)
replicate
ok
![Page 24: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/24.jpg)
leave
Add node
copy
copy
leave
leave
copy
![Page 25: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/25.jpg)
Key = “foo”# = N, R = 2
N
Lookup key(sloppy
quorum)
Value = “bar”
![Page 26: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/26.jpg)
leave
Removenode
copy
![Page 27: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/27.jpg)
stableupdates
Da Gossip
RM1Clock table
Replica clock
Update logValueclock
Value
Executed operation table
write RM2
![Page 28: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/28.jpg)
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
![Page 29: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/29.jpg)
Da MapReduce
map reduce
Node X
Node C
N ="Alice"
map
query ="Alice"
Node A
N =„Alice"
Node B
N ="Alice"
map
hitlist
![Page 30: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/30.jpg)
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)
![Page 31: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/31.jpg)
Key = “foo”
N
replicate
Key = “foo”, # = N ->handoff hint = true
Replicafails
![Page 32: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/32.jpg)
Replicarecovershandoff
![Page 33: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/33.jpg)
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
![Page 34: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/34.jpg)
You don't even need to storeanything.
Just distribute yourcalculation, search, batch
![Page 35: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/35.jpg)
Have a look at tendita.com
![Page 36: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/36.jpg)
So it's even comfy to loadyour clown carwith these
![Page 37: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/37.jpg)
Thank you
![Page 38: hand to mouth - nosqlroadshow.comnosqlroadshow.com/.../slides/Baron_HandToMouth.pdf · hand to mouth. Pavlo Baron pavlo.baron@codecentric.de @pavlobaron Geek‘s Guide To The Working](https://reader033.vdocuments.net/reader033/viewer/2022051904/5ff63be2c036526fbe26e7d1/html5/thumbnails/38.jpg)
Most images originate fromistockphoto.com
except few ones takenfrom Wikipedia or Flickr (CC)
and product pages/publicly available presentations
or generated through publiconline generators