Slide 1

Slide 1 text

ashwanth kumar @_ashwanthkumar software engineer suuchi - library of distributed systems primitives

Slide 2

Slide 2 text

blank yep, it’s intentional

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Service

Slide 5

Slide 5 text

Service

Slide 6

Slide 6 text

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

Service Service Service

Slide 11

Slide 11 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 12

Slide 12 text

Distributed (NoSQL) Datastores Service Service Service

Slide 13

Slide 13 text

Distributed (NoSQL) Datastores Service Service Service Network Latency

Slide 14

Slide 14 text

data locality for low latency / data intensive applications

Slide 15

Slide 15 text

Service Service Service Co-locate data to improve performance

Slide 16

Slide 16 text

Sharded and replicated to improve throughput Service Service Service

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

1.1.1.1 1.1.1.2 1.1.1.3 A stats.service.ix 1.1.1.1 1.1.1.2 1.1.1.3 DNS based Load Balancing Distributed stats aggregation system @indix Count(“a”, 1L) Unique(“a”, 1L) Count(“c”, 1L) Unique(“a”, 1L) Count(“b”, 1L) monoid.plus monoid.plus monoid.plus

Slide 19

Slide 19 text

पांग ப Communication key=”foo” key=”bar” key=”baz” Request Routing Sync / Async Replication Replication Data Sharding Cluster Membership distributed system problems

Slide 20

Slide 20 text

suuchi github.com/ashwanthkumar/suuchi library of distributed systems primitives

Slide 21

Slide 21 text

+ HandleOrForward - Broadcast - ScatterGather primitives - communication uses http/2 with streaming

Slide 22

Slide 22 text

+ Consistent Hash Ring - Your own sharding technique? primitives - sharding/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

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

Slide 24

Slide 24 text

primitives - replication sync async provides very high availability for write systems at the cost of eventual consistency every request is successful only if all the replicas succeeded

Slide 25

Slide 25 text

+ KeyValue + RocksDB - Your Own Abstraction? primitives - storage embedded KV store from FB for server workloads

Slide 26

Slide 26 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 27

Slide 27 text

let’s see some code see reference for actual links

Slide 28

Slide 28 text

- HTML Archive System - Handles 1000+ tps - write heavy system - Stores ~120TB of url and timestamp indexed HTML pages - Stats (as Monoids) Storage System* - All we want is 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 29

Slide 29 text

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

Slide 30

Slide 30 text

questions? references available at github.com/ashwanthkumar/suuchi-ds-primitives

Slide 31

Slide 31 text

more on consistent hash ring

Slide 32

Slide 32 text

primitives - 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 33

Slide 33 text

primitives - 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 34

Slide 34 text

primitives - 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 35

Slide 35 text

primitives - 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 36

Slide 36 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. primitives - request routing