Global Architecture Josh Evans - Director of Operations Engineering - - PowerPoint PPT Presentation

global architecture
SMART_READER_LITE
LIVE PREVIEW

Global Architecture Josh Evans - Director of Operations Engineering - - PowerPoint PPT Presentation

#NetflixEverywhere Global Architecture Josh Evans - Director of Operations Engineering March, 2016 December 24 th , 2012 Disappointment Outrage Withdrawal December 24th, 2012 Failure is inevitable Failure-Driven Architecture Never fail the


slide-1
SLIDE 1

Josh Evans - Director of Operations Engineering March, 2016

#NetflixEverywhere Global Architecture

slide-2
SLIDE 2

December 24th, 2012

slide-3
SLIDE 3

Disappointment

slide-4
SLIDE 4

Outrage

slide-5
SLIDE 5

Withdrawal

slide-6
SLIDE 6

December 24th, 2012

slide-7
SLIDE 7
slide-8
SLIDE 8

Failure is inevitable

slide-9
SLIDE 9

Never fail the same way twice

Failure-Driven Architecture

slide-10
SLIDE 10

#NetflixEverywhere

Failure-Driven Architecture

Never fail the same way twice

slide-11
SLIDE 11
  • Introductions
  • Failure-Driven Architecture
  • Taking It Global

#NetflixEverywhere

Our Talk Today

slide-12
SLIDE 12
  • Introductions
  • Failure-Driven Architecture
  • Taking It Global

#NetflixEverywhere

Our Talk Today

slide-13
SLIDE 13

1999 – 2009

  • Ecommerce (DVD  Streaming)

2009 – 2013

  • Playback Services (Activate, Manifests, DRM)

2013 - present

  • Operations Engineering

– CD, RTA, Chaos, Performance

Josh Evans – Director of Operations Engineering

jevans@netflix.com

slide-14
SLIDE 14

Bringing movies & TV shows from all over the world to people all over the world

  • Streaming, on demand, subscription
  • Global & regional licensing
  • Hollywood, independent, international
  • Striving for global ubiquity
slide-15
SLIDE 15

2007

  • Jan – Windows

2008

  • May – Roku
  • Oct – LG, Samsung Blu-ray
  • Oct – Apple Mac
  • Nov – XBox 360

2009

  • Jun – LG DTV
  • Nov –Sony PS3 (disc)
  • Nov – Sony Bravia

– DTV & Blu-ray

Device Ubiquity

slide-16
SLIDE 16

2011

  • May – Android
  • Nov – First e-readers

– Kindle Fire, Nook

Device Ubiquity

2010

  • Mar – Nintendo Wii (disc)
  • Apr – Apple iPad
  • Aug – Apple iPhone
  • Sep – Apple TV
  • Oct – Sony PS3 (no disc)
  • Oct – Nintendo Wii (no disc)
  • Nov – Windows Phone 7
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19

2010 - Canada 2011 - Latin America 2012 - UK, Ireland, Nordics 2013 – Netherlands 2014 - Austria, Belgium, France, Germany, Luxembourg, Switzerland 2015 - Australia, New Zealand, Japan, Spain, Italy, Portugal

Geographic Ubiquity

slide-20
SLIDE 20
  • English
  • Spanish (Latin American)
  • Portuguese (Brazilian)
  • Dutch
  • French
  • German
  • Japanese
  • Spanish (Castilian)
  • Italian
  • Portuguese (European)

Language Ubiquity - Subs, Dubs, UI

slide-21
SLIDE 21

75,000,000

slide-22
SLIDE 22
  • Introductions
  • Failure-Driven Architecture
  • Taking It Global

#NetflixEverywhere

Our Talk Today

slide-23
SLIDE 23

August 2008

slide-24
SLIDE 24
  • No automation, virtualization, standardization
  • Manual, error prone, slow
  • Big iron & monoliths

DC2

2009

slide-25
SLIDE 25

Undifferentiated Heavy Lifting

slide-26
SLIDE 26

US-East-1

Amazon Web Services

2010

  • Scale & elasticity
  • Virtual, programmable
  • Global footprint
slide-27
SLIDE 27
  • Micro-services
  • Database
  • Cache
  • Traffic

Architectural Pillars

slide-28
SLIDE 28
  • Micro-services
  • Database
  • Cache
  • Traffic

Architectural Pillars

slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32

FIT

Fault-Injection Test Framework

Micro-service Failure

slide-33
SLIDE 33
  • Micro-services
  • Database
  • Cache
  • Traffic

Architectural Pillars

slide-34
SLIDE 34

NoSQL but…

  • Not web scale
  • Throttling

Modest scale

  • 100s of play starts / second
  • 10,000s of requests / second
  • 10s of billions of records

SimpleDB

slide-35
SLIDE 35
  • Micro-services
  • Database
  • Cache
  • Traffic

Architectural Pillars

slide-36
SLIDE 36

Ephemeral Volatile memCache (EVCache) Clustered memcached optimized for Netflix use cases

slide-37
SLIDE 37

EVCache Server Memcached

Prana (Sidecar) Monitoring & Other Processes

Eureka Client Application Client Library EVCache Client

Shards, consistent hashing TTLs & LRU

EVCache Architecture

slide-38
SLIDE 38

Zone A Client Application Client Library EVCache Client Zone B Client Application Client Library EVCache Client Zone C Client Application Client Library EVCache Client . . . . . . . . .

Reads

slide-39
SLIDE 39

Zone A Zone B Zone C . . . . . . . . .

Writes

Client Application Client Library EVCache Client Client Application Client Library EVCache Client Client Application Client Library EVCache Client

slide-40
SLIDE 40
  • 1. Read from cache
  • 2. On cache miss call service
  • 3. Service calls DB & responds
  • 4. Service updates cache

Client Application Client Library EVCache Client Service Client S S S S . . . DB DB DB DB . . . . . .

Fronting Micro-services

. . .

slide-41
SLIDE 41

Linear Scaling

  • 30 million requests/sec
  • 2 trillion requests per day globally
  • Hundreds of billions of objects
  • Tens of thousands of memcached instances
  • Milliseconds of latency per request
slide-42
SLIDE 42

US-East-1

Canada

International Expansion

2011

US Latin America

slide-43
SLIDE 43

US-East-1 EU-West-1

Cloud Islands

2012

slide-44
SLIDE 44
  • Micro-services
  • Database
  • Cache
  • Traffic

Architectural Pillars

slide-45
SLIDE 45

US-East-1 EU-West-1

UK/IE, Nordics, Netherlands Latin America

DNS Geo Mapping

Canada US

slide-46
SLIDE 46
  • Micro-services
  • Database!
  • Caching
  • Traffic

Architectural Pillars

slide-47
SLIDE 47

Why Cassandra?

  • NoSQL at scale
  • Open source
  • Multi-region
  • Multi-directional
  • CAP Choices

– Availability – Partition tolerance – Eventual consistency*

Scalable, Durable, Global

slide-48
SLIDE 48

Single Region, Multiple AZs

1. Client writes to any node 2. Coordinator replicates to nodes 3. Nodes ack to coordinator 4. Coordinator acks to client 5. Write to commit log

Zone A Zone B Zone C Zone B Zone C Client Zone A

  • Hinted handoff to offline nodes

Local Quorum

(Typical)

100ms

slide-49
SLIDE 49

Not quite fast enough

slide-50
SLIDE 50

December 24th, 2012

slide-51
SLIDE 51

US-East-1 US-West-2 EU-West-1

Isthmus

Spring 2013

Survive a regional ELB outage

slide-52
SLIDE 52

AZ1 AZ2 AZ3 US-EAST-1 ELBs Zuul Data Data Data Geo-located

state/province

AZ1 AZ2 AZ3 US-WEST-2 ELBs Zuul Data Data Data Americas Internet Traffic

Eastern NA + LatAm Traffic

  • Zuul routes locally or remotely
  • Eureka - multi-region aware

Isthmus

slide-53
SLIDE 53

US-East-1 US-West-2 EU-West-1

Active-Active

2013 - 2014

Survive a large-scale regional service outage

slide-54
SLIDE 54

Active-Active Data Replication

slide-55
SLIDE 55

Region B Region A

Zone A Zone B Zone C Zone B Zone C Zone A Zone A Zone B Zone C Zone C Client Client Zone A Zone B

Multi-Region Writes

500ms

Bi-directional Nightly compare & repair

Local Quorum

(Typical)

slide-56
SLIDE 56

EVCache Replication Repl Writer SQS

Application

Client

EVCache Replication Repl Writer

  • 1. Set or

delete

  • 2. send

metadata

  • 3. poll msg
  • 6. set or

delete

Application

Client

SQS

  • 7. read

EVCache Cross-Region Replication

Region B Region A

slide-57
SLIDE 57

Active-Active Traffic Management

slide-58
SLIDE 58

ELB US-West-2 ELB US-East-1 ELB EU-West-1

DNS

api-global.netflix.com UltraDNS Route53

slide-59
SLIDE 59

DNS

api-global.netflix.com

  • Remove state from geo bucket

ELB US-West-2 ELB US-East-1 ELB EU-West-1

slide-60
SLIDE 60

api-global.netflix.com

DNS

  • Remove state from geo bucket
  • Add state to geo bucket
  • Log event
  • For each end point

ELB US-West-2 ELB US-East-1 ELB EU-West-1

slide-61
SLIDE 61

api-global.netflix.com api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.neflix.com

ELB ELB ELB

Shim

slide-62
SLIDE 62

api-global.netflix.com api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.neflix.com

ELB ELB ELB

Shim

slide-63
SLIDE 63

api-global.netflix.com api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.neflix.com

ELB ELB ELB

Shim

slide-64
SLIDE 64

Active-Active Failover

slide-65
SLIDE 65
slide-66
SLIDE 66
  • Introductions
  • Failure-Driven Architecture
  • Taking It Global

#NetflixEverywhere

Our Talk Today

slide-67
SLIDE 67

January 6th, 2016

slide-68
SLIDE 68

Geographic Ubiquity

slide-69
SLIDE 69

Before Global

  • English
  • Spanish (Latin American)
  • Portuguese (Brazilian)
  • Dutch
  • French
  • German
  • Japanese
  • Spanish (Castilian)
  • Italian
  • Portuguese (European)

Global

  • Chinese
  • Korean
  • Arabic

Language Ubiquity

slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72

March 18th, 2016 Daredevil Season 2 All episodes, all devices, all countries Simultaneously

Content Ubiquity

slide-73
SLIDE 73

Ubiquitous, Resilient Architecture

slide-74
SLIDE 74

US-East-1 US-West-2 EU-West-1

Reliably and efficiently serve any customer from any region

Netflix Global

2015

slide-75
SLIDE 75

US-East-1 US-West-2 EU-West-1

slide-76
SLIDE 76

US-East-1 US-West-2 EU-West-1

slide-77
SLIDE 77

Ubiquitous Data

slide-78
SLIDE 78

EVCache Replication Repl Writer

Application

Client

Kafka

SQS

  • High latency
  • Read once

Kafka

  • Low latency
  • Multiple readers
  • > 1M replications/sec
slide-79
SLIDE 79

US Ring US Ring EU Ring EU-West-1 US-East-1

  • 1. Extend US ring to EU region & run repairs

Client

  • 2. Dual Write
  • 3. Forklift
slide-80
SLIDE 80

EU-West-1 US-West-2 Global Ring Global Ring US-East-1 Global Ring

slide-81
SLIDE 81

Ubiquitous Traffic Management

slide-82
SLIDE 82

us-east-1-na

  • East US
  • East CA
  • MX

us-west-2

  • APAC
  • West US
  • West CA

eu-west-1

  • Europe
  • Mid East
  • Africa

us-east-1-sa

  • LatAm
  • Not MX

Virtual DNS Regions

slide-83
SLIDE 83
  • Fixed virtual modules
  • Origin tier
  • Standardized names

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

DNS Tiers

slide-84
SLIDE 84

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Split Failover

slide-85
SLIDE 85

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.neflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Split Failover

slide-86
SLIDE 86

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Cascading Failover

slide-87
SLIDE 87

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Cascading Failover

slide-88
SLIDE 88

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Cascading Failover

slide-89
SLIDE 89

api-global.netflix.com

api-global.us-west-2

.prodaa.neflix.com

api-global.us-east-1-sa

.prodaa.neflix.com

api-global.us-east-1-na

.prodaa.neflix.com

api-global.eu-west-1

.prodaa.netflix.com

api-global.us-west-2.origin

.prodaa.neflix.com

api-global.us-east-1.origin

.prodaa.neflix.com

api-global.eu-west-1.origin

.prodaa.neflix.com

ELB ELB ELB

Virtual Origin

Cascading Failover

slide-90
SLIDE 90
slide-91
SLIDE 91

x x

Multi-region Failover

slide-92
SLIDE 92

January 6th, 2016

slide-93
SLIDE 93

“Going global is just like having a baby.”

  • Reed Hastings, Netflix CEO
slide-94
SLIDE 94

What’s next?

  • Global latency
  • Edge computing
  • ML-based monitoring
  • Self-healing systems
  • Capacity utilization
  • Fast, autonomous traffic
  • Integrate DB & caching

#NetflixEverywhere

slide-95
SLIDE 95

Takeaways

slide-96
SLIDE 96

Never fail the same way twice

Christmas Eve 2012 Today

slide-97
SLIDE 97

Know your resiliency patterns

Pattern Properties

DC SPoF, infrastructure heavy lifting Cloud (one region) Multiple DCs, one control plane Islands Regional containment Isthmus Regional ELB bypass Active-active Regional failover Global Ubiquity, resiliency, efficiency

slide-98
SLIDE 98

Invest in architectural pillars

  • Micro-services
  • Database
  • Caching
  • Traffic
slide-99
SLIDE 99

#NetflixEverywhere

Think globally, act locally

slide-100
SLIDE 100

netflix.github.io

slide-101
SLIDE 101

netflix.github.io

slide-102
SLIDE 102

Netflix Tech Blog

techblog.netflix.com

slide-103
SLIDE 103

Josh Evans

jevans@netflix.com @ops_engineering

#NetflixEverywhere Global Architecture

? ? ? ? ?