Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large...

86

Transcript of Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large...

Page 1: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 2: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices @ SpotifyKevin Goldsmith VP Engineering

@kevingoldsmith

Page 3: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Let’s say I wanted to build a large application

Page 4: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

Page 5: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

Page 6: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

‣ Support multiple platforms

Page 7: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

‣ Support multiple platforms

‣ Handle complex business rules

Page 8: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

‣ Support multiple platforms

‣ Handle complex business rules

‣ Competitive in a fast moving market

Page 9: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

‣ Support multiple platforms

‣ Handle complex business rules

‣ Competitive in a fast moving market

‣ React Quickly

Page 10: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Some requirements

‣ Must scale to millions of users

‣ Support multiple platforms

‣ Handle complex business rules

‣ Competitive in a fast moving market

‣ React Quickly

‣ Out-innovate

Page 11: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

Page 12: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 13: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 14: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

Page 15: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

Page 16: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

Page 17: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

Page 18: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

‣ > 2B playlists

Page 19: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

‣ > 2B playlists

‣ Incredibly complex business rules

Page 20: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

‣ > 2B playlists

‣ Incredibly complex business rules

‣ Lots of competition

Page 21: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

‣ > 2B playlists

‣ Incredibly complex business rules

‣ Lots of competition

Page 22: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

A product like this

‣ 75+ Million Monthly Active Users

‣ 58 Countries

‣ > 20,000 songs added per day

‣ > 2B playlists

‣ Incredibly complex business rules

‣ Lots of competition

Page 23: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

How do you support these requirements while moving fast and innovating?

Page 24: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

SolutionAutonomous full-stack teams

Page 25: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Autonomous

adjective au·ton·o·mous - \ȯ-ˈtä-nə-məs\

(of a country or region) having the freedom to govern itself or control its own affairs. "the federation included sixteen autonomous republics" having the freedom to act independently. "school governors are legally autonomous" synonyms: self-governing, independent, sovereign, free, self-ruling, self-determining, autarchic; self-sufficient "an autonomous republic"

Page 26: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Autonomous

adjective au·ton·o·mous - \ȯ-ˈtä-nə-məs\

(of a country or region) having the freedom to govern itself or control its own affairs. "the federation included sixteen autonomous republics"

having the freedom to act independently. "school governors are legally autonomous" synonyms: self-governing, independent, sovereign, free, self-ruling, self-determining, autarchic; self-sufficient "an autonomous republic"

Page 27: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 28: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 29: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 30: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 31: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 32: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 33: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Challenges

Page 34: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Page 35: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementation

Page 36: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementation depends on

Page 37: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementationCore Library Implementation

depends on

Page 38: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementationCore Library Implementation

depends on depends on

Page 39: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementationCore Library Implementation

depends on depends on

Server Implementation

Page 40: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementationCore Library Implementation

depends on depends on depends onServer Implementation

Page 41: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

ChallengesSynchronization

Client UX implementationCore Library Implementation

depends on depends on depends onServer Implementation

Infrastructure Implementation

Page 42: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 43: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

platforms

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Page 44: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

platforms

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Page 45: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

platforms

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Page 46: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

platforms

Server

Core Library

Platform Platform Platform Platform

Infrastructure

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Feat

ure

Team

Page 47: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 48: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What this looks like at Spotify

Page 49: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What this looks like at Spotify

‣ 90+ teams

Page 50: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What this looks like at Spotify

‣ 90+ teams

‣ 600+ Developers

Page 51: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What this looks like at Spotify

‣ 90+ teams

‣ 600+ Developers

‣ 5 Development offices

Page 52: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What this looks like at Spotify

‣ 90+ teams

‣ 600+ Developers

‣ 5 Development offices

‣1 Product

Page 53: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Full-stack autonomous teamsRequires you to structure your application in loosely coupled parts

Page 54: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Services

Page 55: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 56: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 57: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 58: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 59: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Load

Bal

lanc

er

Page 60: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 61: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 62: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 63: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Easier to scale based on real-world bottlenecks

Page 64: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Easier to test

Page 65: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Easier to deploy

Page 66: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Easier to monitor

Page 67: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Can be versioned independently

Page 68: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 69: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices yay!

Are less susceptible to large failures

Page 70: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 71: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices boo!

are harder to monitor

Page 72: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices boo!

need good documentation / discovery tools

Page 73: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 74: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Microservices boo!

create increased latency

Page 75: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 76: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 77: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What does this look like at Spotify?

Page 78: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What does this look like at Spotify?

‣ 810 active services

Page 79: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What does this look like at Spotify?

‣ 810 active services

‣ ~10 Systems per squad

Page 80: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What does this look like at Spotify?

‣ 810 active services

‣ ~10 Systems per squad

‣ ~1.7 Systems per person with access to production servers

Page 81: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

What does this look like at Spotify?

‣ 810 active services

‣ ~10 Systems per squad

‣ ~1.7 Systems per person with access to production servers

‣ ~1.15 Systems per member of Technology

Page 82: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 83: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

http://spotify.github.io/apollo/

Page 84: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation
Page 85: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation

Questionstwitter: @kevingoldsmith

(yes, we’re hiring)

Page 86: Microservices at Spotify - GOTO Conference · Microservices yay! Are less susceptible to large failures. Microservices boo! are harder to monitor. Microservices boo! need good documentation