paved paas to microservices

76
The Paved PaaS to Microservices Yunong Xiao, Principal Software Engineer, Netflix yunong@netflix.com, @yunongx, http://yunong.io June 26, 2017

Upload: yunong-xiao

Post on 21-Jan-2018

607 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Paved PaaS to Microservices

The Paved PaaS to Microservices

Yunong Xiao,Principal Software Engineer, Netflix

[email protected], @yunongx, http://yunong.io

June 26, 2017

Page 2: Paved PaaS to Microservices

100 million customers

in over 190 countries

streaming 125 million hrs/day

Page 3: Paved PaaS to Microservices

–Wikipedia

“Platform as a service (PaaS)… allows customers to develop, run, and manage applications without the

complexity of building and maintaining the infrastructure and platform…”

What is a Platform as a Service (Paas), Anyway?

Page 4: Paved PaaS to Microservices

Our Use Case

Page 5: Paved PaaS to Microservices
Page 6: Paved PaaS to Microservices

Netflix Edge API

Script A

Script B

Script C

Script D

Script N

Client Library A

Client Library B

Client Library C

Client Library N

Backend Service A

Backend Service B

Backend Service C

Backend Service N

1000+100

Page 7: Paved PaaS to Microservices

TV

iOS

Android

Windows

Browsers

Discovery

Playback

Non-member

Backend Service A

Backend Service B

Backend Service C

Backend Service N

Clients Standalone Services Edge API Backend Services

Owned by client teams

Mostly

Page 8: Paved PaaS to Microservices

Know Your Customer

Page 9: Paved PaaS to Microservices

GoalsVelocity Reliability

Page 10: Paved PaaS to Microservices

Our PaaS to Achieving Both

1. Standardized components

2. Preassembled platform

3. Automation and tooling

Page 11: Paved PaaS to Microservices

1. Standardized Components

Page 12: Paved PaaS to Microservices

What’s Inside a Microservice?RPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Page 13: Paved PaaS to Microservices

Why Standards?

Page 14: Paved PaaS to Microservices

Mélange of RPC

Page 15: Paved PaaS to Microservices

Microservice Interactions

µServiceClient

uService

µService

µService

µService

µService

µService

Page 16: Paved PaaS to Microservices

Failure: When not If

Page 17: Paved PaaS to Microservices

– Managers everywhere

“Is it fixed yet?”

Mean Time to Detection (MTTD)

Mean Time to Repair (MTTR)

Page 18: Paved PaaS to Microservices

N Flavors of RPC

µServiceClient

uService

µService

µService

µService

µService

µService

Page 19: Paved PaaS to Microservices

One Standard RPC

µServiceClient

uService

µService

µService

µService

µService

µService

Page 20: Paved PaaS to Microservices

Benefits of Standardizing

Consistency Leverage Interoperability Quality Support

RPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Page 21: Paved PaaS to Microservices

But I'm a Snowflake...

Freedom Responsibility&

Off-road Innovation Reintegrate Burden VacuumNew

Page 22: Paved PaaS to Microservices

2. Preassembled Platform

Page 23: Paved PaaS to Microservices

Assembly Required

RPC

Discovery

Registration

Runtime

OS

Configuration

Metrics

Logging

Tracing

Dashboards

Alerts

Stream Processing

Page 24: Paved PaaS to Microservices

Getting Out of the BlocksDocs

Copy/paste

Which versions?

Initialization

Configuration

Missing components

Days or weeks

Page 25: Paved PaaS to Microservices

Velocity ReliabilityProduct Innovation

Not a single line of business logic!

Page 26: Paved PaaS to Microservices

Assembly Required

RPC

Discovery

Registration

Runtime

OS

Configuration

MetricsLogging

Tracing

Dashboards

Alerts

Stream Processing

Page 27: Paved PaaS to Microservices

Preassembled PlatformRPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Page 28: Paved PaaS to Microservices

Out of the Box

Page 29: Paved PaaS to Microservices

Component Management

Page 30: Paved PaaS to Microservices
Page 31: Paved PaaS to Microservices

Insights

Page 32: Paved PaaS to Microservices

Application, system, and runtime metrics & logs

Page 33: Paved PaaS to Microservices

Consistent application, system, and runtime metrics & logs

Reduces MTTD & MTTR

Page 34: Paved PaaS to Microservices

Configures and Initializes CorrectlyBOEING 747-400 NORMAL PROCEDURES CHECKLIST

POWER UP / SAFETY CHECK First Officer Captain

CIRCUITBREAKERS...………………...CHECKED BATTERY……………...………………….………ON STANDBY POWER………………...………..AUTO HYDRAULIC DEMAND PUMPS….………..…..OFF WINDSHIELD WIPERS....……………….……..OFF ALTERNATE FLAPS AND GEAR…………….OFF GEAR LEVER…….………….....…………..DOWN FLAPS…..……………………………....CHECKED APU….………………………………...….RUNNING ELECTRICAL SYSTEM....……SET/APU AVAIL ON APU BLEED AIR…...……………………………ON ISOLATION VALVES…………………………OPEN PACKS………………...……………………NORMAL

PREFLIGHT First Officer Captain

EMERGENCY EQUIPMENT…….…….CHECKED FIRE PROTECTION…………...………CHECKED INTERRUPT SWITCHES………………………ON PASSENGER OXYGEN……………..……NORMAL STAB TRIM CUTOUT SWITCHES………….AUTO NAV EQUIPMENT………………………..CHECKED OXYGEN AND INTERPHONE…………CHECKED GEAR PINS………………..……………….STOWED FLIGHTDECK LIGHTS………………………..SET SERVICEABILITY……………………….CHECKED FMC…………………………...……SET / CHECKED CREW BRIEFING…………………..COMPLETED EEC PUSHBUTTONS…………………….NORMAL IRS…………………………………………………NAV HYDRAULIC SYSTEM…………………………SET EMERGENCY LIGHTS…………….……….ARMED AUDIO SYSTEMS…………………………NORMAL INTERPHONE SWITCHES……………………OFF ANTI-ICE SYSTEMS…………………………….OFF WINDOW HEAT……………………………...……ON YAW DAMPERS………………………..…………ON VOICE RECORDER………………………………ON PRESSURIZATION………………………………SET AIRCONDITIONING…………………..…………SET BLEED PANEL……………………….…………..SET EXTERIOR LIGHTS (WING/LOGO)…….……SET EFIS CONTROL PANELS………………………SET MODE CONTROL PANEL………………………SET STANDBY INSTRUMENTS……………………SET SPEEDBRAKES………...…………….RETRACTED THRUST LEVERS….………DOWN AND CLOSED PARKING BRAKES……………………………...SET FUEL CONTROL SWITCHES………...…..CUTOFF COMMUNICATIONS…………………………….SET RADAR……………………………………………SET NO SMOKING SIGN……………………………..ON EVAC SIGNAL…………………...………………ARM

TRANSPONDER…………………………………SET SOURCE SELECTORS…………………...…….SET CLOCKS…………………………………………..SET CRT SELECTORS…………………………NORMAL PFD………………………………………CHECKED ND…………………………………………CHECKED AUTOBRAKES…………………………………RTO EIU SELECTOR………………………………AUTO HDG REFERENCE SWITCH….…………NORMAL FMC MASTER SELECTOR…………………LEFT GROUND PROX SYSTEM……………CHECKED

BEFORE STARTING First Officer Captain

HYDRAULIC DEMAND PUMPS……………………. .............................................AUTO, AUX (1 AND 4) BRAKE PRESSURE……..……………….NORMAL FUEL QUANTITY………………..…………. ____KG FUEL SYSTEM………………………………….SET X-FEEDS…………………OPEN (1 & 4 CLOSED) SEAT BELTS SIGN………………………………ON NOTOC………………………………….CHECKED SHIPS PAPERS…………………………ON BOARD PERFORMANCE DATA......…CHECKED AND SET V2……………………………….…………………SET LNAV AND VNAV…………...……………………SET DOORS…………………..………………….CLOSED YELLOW DOOR SELECTORS AUTOMATIC……... ……………………………………...….ANNOUNCED RECALL………………………….………..CHECKED ENGINE DISPLAY.………………………SELECTED BEACON LIGHTS…………………………BOTH ON

BEFORE TAXI First Officer Captain

APU……………………………..…………………OFF HYDRAULIC DEMAND PUMPS..………ALL AUTO ANTI-ICE SYSTEMS……….……………………SET AFT CARGO HEAT…………………………….…ON RECALL………………………..………….CHECKED GROUND EQUIPMENT………………..REMOVED

(START TAXI)

PARKING BRAKES……………………….RELEASE EXTERIOR LIGHTS……………………..…TAXI ON TIMER/STOPWATCH...………………………START

Page 35: Paved PaaS to Microservices

Versions Updates Compatibility

Page 36: Paved PaaS to Microservices

Important Questions

Page 37: Paved PaaS to Microservices

What’s in and out?

Page 38: Paved PaaS to Microservices

Maintenance vs Convenience

RPC Discovery Registration

Runtime OS Configuration

Metrics Logging Tracing

Dashboards Alerts Stream Processing

Base Platform

Page 39: Paved PaaS to Microservices

Solution: Layers & Flavors

Base platform

Data access

Rendering

Backend

Page 40: Paved PaaS to Microservices

How to Ensure Platform Correctness?

Page 41: Paved PaaS to Microservices

Test, Test, Test

Unit

Integration

Functional

CloudEvery PR

Page 42: Paved PaaS to Microservices

Dog Food with your own Service

Page 43: Paved PaaS to Microservices

Component Correctness

Lock down versions

Test components

Updates require PRs

Gate Keeper

RPC Discovery Registration

Runtime OS Configuration

Metrics Logging Tracing

Dashboards Alerts Stream ProcessingCustomers

Page 44: Paved PaaS to Microservices

How Locked Down is it?

Page 45: Paved PaaS to Microservices

Tradeoffs

vs

Flexibility

Reliability

Consistency

Support

Page 46: Paved PaaS to Microservices

Stay on paved path!

Page 47: Paved PaaS to Microservices

Season to Taste

Config overrides

Startup & shutdown hooks

Access to 3rd party libs

Swap, disable, or configure components

Raw component access

Page 48: Paved PaaS to Microservices

Platform Versioning?

Page 49: Paved PaaS to Microservices

API Semantic Versioning

1.2.3 ^1.0.0 ~1.3.0

Page 50: Paved PaaS to Microservices

Use Conventional Changelog

Page 51: Paved PaaS to Microservices

3. Automation and Tooling

Page 52: Paved PaaS to Microservices

Ship a Feature

Page 53: Paved PaaS to Microservices

DevelopmentTesting

Deployment Operations

Steps

Page 54: Paved PaaS to Microservices

Development

Page 55: Paved PaaS to Microservices
Page 56: Paved PaaS to Microservices

Env bootstrap Integrate tooling & services Run local & cloud

CLI for common dev experience

Page 57: Paved PaaS to Microservices

Local Development

Live reload

Attach debugger

localhost

PROD

Page 58: Paved PaaS to Microservices

Testing

Page 59: Paved PaaS to Microservices

Testing

Page 60: Paved PaaS to Microservices

Testing

Preassembled PlatformRPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Page 61: Paved PaaS to Microservices

Preassembled Platform

Pre-Prod

RPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Page 62: Paved PaaS to Microservices

Provide First Class Mocks

RPC Discovery Registration Runtime OS Configuration

Metrics Logging Tracing Dashboards Alerts Stream Processing

Preassembled Platform

Page 63: Paved PaaS to Microservices

Mock Data Generation

RPC +

Page 64: Paved PaaS to Microservices

Mock Ownership

RPC Discovery Registration

Configuration

Metrics Logging Tracing

AlertsStream Processing

Page 65: Paved PaaS to Microservices

Platform Testing API

• Just like a runtime API, need a testing API

• Provide mocks interface for components

• Gets platform out of the loop for providing mocks

Page 66: Paved PaaS to Microservices
Page 67: Paved PaaS to Microservices

Deployment

Page 68: Paved PaaS to Microservices

“Production is war!”

Page 69: Paved PaaS to Microservices

Experience Differences

Page 70: Paved PaaS to Microservices

Deploy and Manage Services

• Pre-configured pipelines for deployment and rollback

• Single command deploy to any stack

• Integration for automated canary analysis

• Pre-configured autoscaling

Page 71: Paved PaaS to Microservices

Operations

Page 72: Paved PaaS to Microservices

Consolidated View

Page 73: Paved PaaS to Microservices

RPS

Latency

Error rates

CPU

Memory

Generated Dashboards & Alerts

Page 74: Paved PaaS to Microservices

CPU profiling Core dump analysis

Automated Analytics & Tooling

Page 75: Paved PaaS to Microservices

Our PaaS to Velocity & Reliability

1. Standardized components

2. Preassembled platform

3. Automation and tooling

Page 76: Paved PaaS to Microservices

The Paved PaaS to Microservices

Yunong Xiao,Principal Software Engineer, Netflix

[email protected], @yunongx, http://yunong.io

June 26, 2017