Slide 1

Slide 1 text

ashwanth kumar @_ashwanthkumar principal engineer suuchi - toolkit for application layer sharding

Slide 2

Slide 2 text

from simple to unmanageable beasts how we scale systems? an opinionated view

Slide 3

Slide 3 text

Service

Slide 4

Slide 4 text

Service

Slide 5

Slide 5 text

Service Service

Slide 6

Slide 6 text

Service Service Service

Slide 7

Slide 7 text

Service Service Service

Slide 8

Slide 8 text

Service Service Service

Slide 9

Slide 9 text

Service Service Service

Slide 10

Slide 10 text

rise of KV stores distributed, replicated, fault-tolerant (optionally sorted) 2006 BigTable from Google 2007 Dynamo from Amazon 2009 VoldemortDB from LinkedIn Cassandra from facebook 2008

Slide 11

Slide 11 text

Distributed (NoSQL) Datastores Service Service Service

Slide 12

Slide 12 text

Distributed (NoSQL) Datastores Service Service Service Network Latency

Slide 13

Slide 13 text

data locality for low latency / data intensive applications

Slide 14

Slide 14 text

Service Service Service Co-locate data to improve performance

Slide 15

Slide 15 text

Sharded and replicated to improve throughput Service Service Service

Slide 16

Slide 16 text

Service Service Service Deal with complex distributed system problems at the application layer

Slide 17

Slide 17 text

suuchi github.com/ashwanthkumar/suuchi toolkit for application layer sharding

Slide 18

Slide 18 text

components - transport uses http/2 with streaming

Slide 19

Slide 19 text

components - membership static dynamic fault tolerance in case of node/process failure scaling up/down needs downtime of the system

Slide 20

Slide 20 text

components - request routing Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web node 2 node 1 node 3 node 4

Slide 21

Slide 21 text

components - request routing Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web node 2 node 1 node 3 node 4

Slide 22

Slide 22 text

components - request routing Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web node 2 node 1 node 3 node 4

Slide 23

Slide 23 text

components - request routing Consistent hashing and random trees: Distributed caching protocols for relieving hot spots on the World Wide Web node 2 node 3 node 4

Slide 24

Slide 24 text

- Peer to Peer system - no single point of contact - Each node handles or forwards requests transparently - Uses pluggable partitioner scheme - Can be customized as weighted distribution / Rendezvous Hash etc. components - request routing

Slide 25

Slide 25 text

- define a gRPC service using proto2 (or proto3) - generate the stubs in java / scala - implement the services - connect them together using Suuchi - Server abstraction getting started

Slide 26

Slide 26 text

let’s see some code see reference for actual links

Slide 27

Slide 27 text

suuchi.proto

Slide 28

Slide 28 text

suuchi.proto

Slide 29

Slide 29 text

implement proto service

Slide 30

Slide 30 text

connect using Server abstraction

Slide 31

Slide 31 text

- HTML Archive System - Handles 1000+ rps - write heavy system - Stores ~120TB of url and timestamp indexed HTML pages - Stats (as Monoids) Storage System* - All we want was approximate aggregates real-time - Real-time scheduler for our crawlers* - Finds out which of the 20 urls to crawl now out of 3+ billion urls - Helps crawler crawl 20+ million urls everyday suuchi @indix

Slide 32

Slide 32 text

idea behind suuchi membership, request routing / sharding 2011 Gizzard from Twitter 2016 Suuchi 2016 Slicer from Google 2015 RingPop from Uber

Slide 33

Slide 33 text

questions? references available at github.com/ashwanthkumar/suuchi-sharding-talk