microservices practitioner summit jan '15 - scaling uber from 1 to 100s of services - matt...

61
SCALING UBER MATT RANNEY

Upload: datawire

Post on 07-Jan-2017

1.938 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

SCALING UBERMATT RANNEY

Page 2: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

As of January 2016:

Uber Cities Worldwide: 361Countries: 67Employees: 5,400Engineers: 1,700US Driver Payments Jan-Oct 2015: $3.5B

Page 3: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 4: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 5: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

UBER ENGINEERING HISTORY

Page 6: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

2009-2010 Outsourced PHP + MySQL

Jan 2011 "dispatch" - Node.JS/MongoDB

Jan 2011 “API” - Python/SQLAlchemy/MySQL

Feb 2012 Dispatch swaps MongoDB for Redis

May 2012 Dispatch adds ON fallback

Jan 2013 First non-API Python services

Feb 2013 API switched to Postgres

Mar 2014 New Python services use MySQL

Mar 2014 Schemaless begins, must finish before pg collapse

Sep 2014 First Schemaless - trips out of Postgres

Aug 2015 Dispatch X.0 / Ringpop / Riak

Jan 2016 Go, Java, Cloud, More Abstractions

Page 7: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

TECHNICAL DEBT

Page 8: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 9: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 10: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 11: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

Credit: NASA, ESA, and R. Thompson (Univ. Arizona)

Page 12: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

Credit: NASA, ESA, and Z. Levay (STScI/AURA)

Page 13: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

MICROSERVICESImmutable?Append Only?

Page 14: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

Node.JSPythonGoJava

Page 15: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

SCALING NODE

Page 16: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 17: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 18: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 19: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 20: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 21: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 22: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 23: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 24: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 25: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 26: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 27: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 28: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 29: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 30: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 31: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 32: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 33: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 34: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 35: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 36: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 37: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

Getting out of the HTTP+JSON businessHTTP is slow, complex, and inconsistentJSON is hard to validate, awkward in non-nodeThrift is OK, but generated code is bad

Page 38: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 39: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 40: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

SERVICE DISCOVERY

Page 41: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 42: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

Lots of services, lots of instancesMostly Node.JS and PythonCall graph unknowableSelf-inflicted DoSCascading failures

Page 43: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 44: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 45: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 46: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 47: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 48: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

load balancerservice A

service B

service B

Page 49: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

load balancer

service A service B

service B

Page 50: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 51: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

horizontal scalabilityzipkin tracingcircuit breakingrate limitingfailure testablealmost no configurationas available as possible

Page 52: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

overall latency ≥ latency of slowest component1ms avg, 1000ms p99use 1: 1% at least 1000msuse 100: 63% at least 1000ms1.0 - 0.99^100 = 0.634 = 63.4%

LATENCY

Page 53: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

requ

ests

that

are

slo

w

0%

25%

50%

75%

100%

Processes Used

1 2 4 8 16 32 64 128 256 512 1024

p95 p99 p99.9

Page 54: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 55: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 56: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber
Page 57: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

CULTURAL CHANGES

Page 58: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

FAILURE TESTING

Page 59: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

RETRIES

Page 60: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

partner app dispatch DC1Location Updates

State Digest

dispatch DC2

Location UpdatesState Request

Page 61: Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Services - Matt Ranney, Uber

THANKS