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

No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

Embed Size (px)

Citation preview

Page 1: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

No free lunch, indeed:Three years

Phil CalçadoSoundCloud

of microservicesat SoundCloud

Page 2: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 3: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 4: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

> 11 hours of audio uploaded every minute

~ 300 million people every month

Page 5: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

heaps have been written about microservices in

the past year-ish

Page 6: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 7: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

tl;dr

• Rapid provisioning• Basic Monitoring• Rapid application deployment

Page 8: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

These make sense

• Rapid provisioning• Basic Monitoring• Rapid application deployment

this makes sense

why does it make me so nervous?

Page 9: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

the SoundCloud story you might know

Page 10: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 11: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

the pre-history

Page 12: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

SoundCloud, circa 2011

Page 13: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

let’s prepare for the “microservices

explosion"

Page 14: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

#1 provisioning

Page 15: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

what was cool in 2010-11

Page 16: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

what was cool in 2010-11

doozer lxc 12factor.net

Page 17: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

much better than anything else at the

time

Page 18: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

a problem

no resource limits (i.e. cgroups)+

naïve scheduling=

loud neighbour in your own datacentre

Page 19: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

a problemmade for

most of our services migrated to

Page 20: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

the problem

time

start workon v1

v1 100% deployed

start work on v2

Page 21: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

before we go sophisticated, let’s

simplify what we have

Page 22: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

warmed up pool

machineintake

Page 23: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

not the final solution, but will buy us some

time

Page 24: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

#2 telemetry

Page 25: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

state of telemetry tools circa 2011-12 wasn’t

great

Page 26: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

StatsD

Page 27: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

let’s build our own!

Page 28: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 29: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

but that’s not what broke…

Page 30: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

obvious with a monolith

monolith

Page 31: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

not so much now

?

?

?

Page 32: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

standardise dashboards

Page 33: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

standardise operations

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

Page 34: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

visualise

Page 35: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

add management lines, all the way up, to

escalation policies

Page 36: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

#3 deployment

Page 37: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud
Page 38: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

> git

SquashFS

> make

unit tests integration tests

acceptance tests perf tests

> make

/dev/null

Page 39: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

we ended up with 7 different deployment

scripts

Page 40: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

> make > gitunit tests integration tests

unit tests integration tests

acceptance tests perf tests

Page 41: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

containers let you spawn your mini-

SoundCloud

Page 42: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

but why was I so nervous?

Page 43: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

because wemessed up

Page 44: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

there are simple and incremental ways to address these

• Rapid provisioning• Basic Monitoring• Rapid application deployment

Page 45: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

“uh? do you think Netflix got it right the

first time?"

Page 46: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

some good things

Page 47: No Free Lunch, Indeed: Three Years of Micro-services at SoundCloud

Q&A