three years of microservices at soundcloud - distributed matters berlin 2015

50
No free lunch, indeed: Three years Phil Calçado SoundCloud of microservices at SoundCloud

Upload: phil-calcado

Post on 11-Jan-2017

1.461 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

No free lunch, indeed:Three years

Phil CalçadoSoundCloud

of microservicesat SoundCloud

Page 2: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

No free lunch, indeed:Three years

Phil CalçadoSoundCloud

of microservicesat SoundCloud

Page 3: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 4: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 5: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

> 11 hours of audio uploaded every minute

~ 300 million people every month

Page 6: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

heaps have been written about microservices in

the past year-ish

Page 7: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 8: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

tl;dr

• Rapid provisioning• Basic Monitoring• Rapid application deployment

Page 9: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

These make sense

• Rapid provisioning• Basic Monitoring• Rapid application deployment

this makes sense

why does it make me so nervous?

Page 10: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

the SoundCloud story you might know

Page 11: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

we moved to microservices

because $reasons

http://bit.ly/how_we_ended_up_with_microservices

Page 12: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 13: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

the pre-history

Page 14: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

SoundCloud, circa 2011

Page 15: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

let’s prepare for the “microservices

explosion"

Page 16: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

#1 provisioning

Page 17: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

what was cool in 2010-11

Page 18: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

what was cool in 2010-11

doozer lxc 12factor.net

Page 19: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

much better than anything else at the

time

Page 20: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

a problem

no resource limits (i.e. cgroups)+

naïve scheduling=

loud neighbour in your own datacentre

Page 21: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

a problemmade for

most of our services migrated to

Page 22: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

the problem

time

start workon v1

v1 100% deployed

start work on v2

Page 23: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

attempt #1 - before we go sophisticated, let’s simplify what we have

Page 24: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

warmed up pool

machineintake

Page 25: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

just a bit of glue code

Page 26: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

just a bit of glue codea LOT

Page 27: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

machineintake

Page 28: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

#2 telemetry

Page 29: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

state of telemetry tools circa 2011-12 wasn’t

great

Page 30: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

StatsD

Page 31: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

let’s build our own!

Page 32: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 33: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

but that’s not what broke…

Page 34: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

obvious with a monolith

monolith

Page 35: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

not so much now

?

?

?

Page 36: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

standardise dashboards

Page 37: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

standardise operations

https://twitter.github.io/twitter-server/Features.html#http-admin-interface

Page 38: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

visualise

Page 39: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

#3 deployment

Page 40: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Page 41: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

> git

SquashFS

> make

unit tests integration tests

acceptance tests perf tests

> make

/dev/null

Page 42: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

we ended up with 7 different deployment

scripts

Page 43: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

> make > gitunit tests integration tests

unit tests integration tests

acceptance tests perf tests

Page 44: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

containers let you spawn your mini-

SoundCloud

Page 45: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

but why was I so nervous?

Page 46: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

because wemessed up

Page 47: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

there are simple and incremental ways to address these

• Rapid provisioning• Basic Monitoring• Rapid application deployment

Page 48: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

“wtf? do you think Netflix got it right the first time?”

— @adrianco

Page 49: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

some of the good things

Page 50: Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015

Q&A