How We Know Where You Are in House of Cards @zimmermatt Netflix - - PowerPoint PPT Presentation

how we know where you are in house of cards
SMART_READER_LITE
LIVE PREVIEW

How We Know Where You Are in House of Cards @zimmermatt Netflix - - PowerPoint PPT Presentation

Netflixs Viewing Data Microservices How We Know Where You Are in House of Cards @zimmermatt Netflix Scale @zimmermatt Netflix Scale 62,000,000 @zimmermatt Netflix Scale 62,000,000 50+ @zimmermatt Netflix Scale 62,000,000 50+


slide-1
SLIDE 1

How We Know Where You Are in House of Cards

Netflix’s Viewing Data Microservices

@zimmermatt

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4

Netflix Scale

@zimmermatt

slide-5
SLIDE 5

Netflix Scale

62,000,000

@zimmermatt

slide-6
SLIDE 6

Netflix Scale

62,000,000 50+

@zimmermatt

slide-7
SLIDE 7

Netflix Scale

62,000,000 50+ 3,000,000,000+

@zimmermatt

slide-8
SLIDE 8

Netflix Scale

62,000,000 50+ 3,000,000,000+ 1000+

@zimmermatt

slide-9
SLIDE 9

Netflix Scale

62,000,000 50+ 3,000,000,000+ 1000+ 37%

@zimmermatt

slide-10
SLIDE 10

Viewing Data

@zimmermatt

slide-11
SLIDE 11

Viewing Data: History

Who

@zimmermatt

slide-12
SLIDE 12

Viewing Data: History

Who, What

@zimmermatt

slide-13
SLIDE 13

Viewing Data: History

Who, What, When

6/10/2015 11:55

@zimmermatt

slide-14
SLIDE 14

Viewing Data: History

Who, What, When, Where

6/10/2015 11:55

@zimmermatt

slide-15
SLIDE 15

Viewing Data: History

Who, What, When, Where, How Long

6/10/2015 11:55

@zimmermatt

slide-16
SLIDE 16

Viewing Data: Telemetry

@zimmermatt

slide-17
SLIDE 17

What have I watched?

@zimmermatt

slide-18
SLIDE 18

What have I watched?

@zimmermatt

slide-19
SLIDE 19

Where was I at?

@zimmermatt

slide-20
SLIDE 20

What else am I watching?

@zimmermatt

slide-21
SLIDE 21

What Happened?

Video Bitrate Usage

@zimmermatt

slide-22
SLIDE 22
slide-23
SLIDE 23

Viewing Data Requests

@zimmermatt

slide-24
SLIDE 24

Viewing Data Requests

@zimmermatt

slide-25
SLIDE 25

Viewing Data Requests

@zimmermatt

slide-26
SLIDE 26

Viewing Data Requests

@zimmermatt

slide-27
SLIDE 27

Viewing Data Requests

@zimmermatt

slide-28
SLIDE 28
slide-29
SLIDE 29

Gen 3 (Existing) System

Summarized Sessions Viewing History History Cache Logs

@zimmermatt

Viewing Service Stateful Tier

1 n-2 n-1 …

Active Sessions Latest Positions Session Summary

Stateless Tier (History, logs, and fallback)

Events

slide-30
SLIDE 30

Gen 3 System’s Architecture & Scale

Logs

@zimmermatt

slide-31
SLIDE 31

Gen 3 System’s Architecture & Scale

Viewing History Logs

@zimmermatt

slide-32
SLIDE 32

Gen 3 System’s Architecture & Scale

Viewing History History Cache Logs

@zimmermatt

slide-33
SLIDE 33

Gen 3 System’s Architecture & Scale

Viewing History History Cache Logs Summarized Sessions

@zimmermatt

slide-34
SLIDE 34

Gen 3 System’s Architecture & Scale

Viewing History History Cache

Viewing Service Stateful Tier

… Stateless Tier (History, logs, and fallback) Logs Summarized Sessions

@zimmermatt

slide-35
SLIDE 35

Gen 3 System’s Architecture & Scale

Viewing History History Cache

Viewing Service Stateful Tier

1 n-2 n-1 …

Active Sessions Latest Positions Session Summary

Stateless Tier (History, logs, and fallback)

Events

Logs Summarized Sessions

@zimmermatt

slide-36
SLIDE 36
slide-37
SLIDE 37

Growth

2015 @zimmermatt

slide-38
SLIDE 38

Virtuous Cycle

Improved Personalization Better Experience Viewing

@zimmermatt

slide-39
SLIDE 39

Stateful Instance Count Over Time

@zimmermatt

slide-40
SLIDE 40

Guiding Lights

slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44

Externalize State…

Viewing History History Cache

Viewing Service Stateful Tier

1 n-2 n-1 …

Active Sessions Latest Positions Session Summary

Stateless Tier (History, logs, and fallback)

Events

Logs Summarized Sessions

@zimmermatt

slide-45
SLIDE 45

Externalize State… DENIED!

Viewing History History Cache

Viewing Service Stateful Tier

1 n-2 n-1 …

Active Sessions Latest Positions Session Summary

Stateless Tier (History, logs, and fallback)

Events

Logs Summarized Sessions

@zimmermatt

slide-46
SLIDE 46

Service Decomposition

Video Bitrate Usage

@zimmermatt

slide-47
SLIDE 47

Service Decomposition

Start Stop @zimmermatt

slide-48
SLIDE 48

Active Sessions Last Position Viewing History Data Feed

Service Decomposition

Start Stop @zimmermatt

slide-49
SLIDE 49

Active Sessions Last Position Viewing History Data Feed

Service Decomposition

Start Stop Event Stream Stream State Session Summary @zimmermatt

slide-50
SLIDE 50

Service Decomposition

Collect Process Provide

Events Queries

@zimmermatt

slide-51
SLIDE 51

Gen 3 Review

Viewing History History Cache Logs Summarized Sessions

@zimmermatt

Viewing Service Stateful Tier

1 n-2 n-1 …

Active Sessions Latest Positions Session Summary

Stateless Tier (History, logs, and fallback)

Events

slide-52
SLIDE 52

Gen 4 Generic Architecture

Processor Provider Collector

@zimmermatt

slide-53
SLIDE 53

Gen 4 Generic Architecture

Processor Provider Collector

Queue

@zimmermatt

slide-54
SLIDE 54

Gen 4 Generic Architecture

Processor Provider Collector

Materialized Views Raw Data Queue

@zimmermatt

slide-55
SLIDE 55

Gen 4 Generic Architecture

Processor Provider Collector

Materialized Views Cache Raw Data Queue

@zimmermatt

slide-56
SLIDE 56

Gen 4 Architecture

Session Summary

Processor

Summarized Sessions

Materialized View

Session Events

Collector

Event Data

Raw Data

Log

Collector

Logs

Raw Data

Viewing History Positions Active Sessions

Materialized View

Session Accounting

Provider

Playback History

Provider

History

Raw Data

@zimmermatt

slide-57
SLIDE 57

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing

Edge Service

Summarized Sessions

Viewing History

History Cache Logs Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Log Collector Logs Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

slide-58
SLIDE 58

Shadow Testing: Start Play Event

Edge Service

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-59
SLIDE 59

Shadow Testing: Start Play Event

Edge Service

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-60
SLIDE 60

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Start Play Event

Edge Service

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

@zimmermatt

slide-61
SLIDE 61

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Start Play Event

Edge Service

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

@zimmermatt

slide-62
SLIDE 62

Shadow Testing: Start Play Event

Edge Service

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-63
SLIDE 63

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events Viewing History Positions Playback History Provider History

Shadow Testing: Read Latest Position

Edge Service @zimmermatt

slide-64
SLIDE 64

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Read Latest Position

Edge Service

Viewing History Positions Playback History Provider History

@zimmermatt

slide-65
SLIDE 65

Shadow Testing: Read Latest Position

Edge Service

Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-66
SLIDE 66

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

slide-67
SLIDE 67

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

slide-68
SLIDE 68

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

slide-69
SLIDE 69

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

slide-70
SLIDE 70

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-71
SLIDE 71

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-72
SLIDE 72

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-73
SLIDE 73

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-74
SLIDE 74

Shadow Testing: Stop Event

Edge Service

Summarized Sessions Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-75
SLIDE 75

Shadow Testing: Stop Event

Summarized Sessions Session Summary Processor Summarized Sessions

@zimmermatt

slide-76
SLIDE 76

Shadow Testing

Edge Service

Summarized Sessions

Viewing History

History Cache Logs Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Log Collector Logs Active Sessions Session Accounting Provider Viewing History Positions Playback History Provider History

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-77
SLIDE 77

Traffic Dial

Session Summary Processor Summarized Sessions Session Events Collector

Event Data

Log Collector Logs Active Sessions Session Accounting Provider

Edge Service

Viewing History Positions Playback History Provider History Summarized Sessions

Viewing History

History Cache Logs

@zimmermatt

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

slide-78
SLIDE 78

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Traffic Dial

Session Events Collector

Event Data

Log Collector Active Sessions Session Accounting Provider

Edge Service

Positions Playback History Provider Summarized Sessions

Viewing History

History Cache Logs Session Summary Processor

@zimmermatt

slide-79
SLIDE 79

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Traffic Dial

Session Events Collector

Event Data

Log Collector Active Sessions Session Accounting Provider

Edge Service

Positions Playback History Provider Summarized Sessions

Viewing History

History Cache Logs Session Summary Processor

@zimmermatt

slide-80
SLIDE 80

Viewing Service Stateful Tier 1 n-2 n-1

Active Sessions Latest Positions Session Summary Stateless Tier (History, logs, and fallback) Events

Traffic Dial

Session Events Collector

Event Data

Edge Service

Summarized Sessions

Viewing History

History Cache Logs Session Summary Processor

@zimmermatt

Active Sessions Session Accounting Provider Positions Playback History Provider

slide-81
SLIDE 81

Viewing Service Stateful Tier 1 n-2 n-1

Latest Positions Stateless Tier (History, logs, and fallback)

Traffic Dial

Edge Service

Viewing History

History Cache

@zimmermatt

Positions Playback History Provider

slide-82
SLIDE 82

Viewing Service Stateful Tier 1 n-2 n-1

Latest Positions Stateless Tier (History, logs, and fallback)

Traffic Dial

Log Collector

Edge Service

Logs

@zimmermatt

slide-83
SLIDE 83

Viewing Service Stateful Tier 1 n-2 n-1

Latest Positions Stateless Tier (History, logs, and fallback)

Traffic Dial

Edge Service

Playback History Provider

Viewing History

History Cache

@zimmermatt

slide-84
SLIDE 84

15

slide-85
SLIDE 85

Migration Status

Session Events Collector

Event Data

Active Sessions Session Accounting Provider

Edge Service

Session Summary Processor Summarized Sessions Log Collector Logs Viewing History Positions Playback History Provider History

@zimmermatt

slide-86
SLIDE 86

Remember this?

@zimmermatt

slide-87
SLIDE 87

This is a typical graph now…

@zimmermatt

slide-88
SLIDE 88

The Road Ahead

@zimmermatt

slide-89
SLIDE 89

Key Points

  • Devour the whale a bite at a time.
  • Use CQRS / Event Sourcing. Backup the raw event
  • data. Design for idempotency so it can be replayed.
  • System architectures are throw-away artifacts, useful for
  • nly a limited time.

@zimmermatt

slide-90
SLIDE 90

“If you don’t like how the table is set, turn over the table.”

Frank Underwood

@zimmermatt