finagle-based microservices at soundcloud

30
Finagle-Based Microservices at SoundCloud Phil Calçado http://philcalcado.com @pcalcado Quick Report:

Upload: phil-calcado

Post on 02-Jul-2015

2.400 views

Category:

Technology


2 download

DESCRIPTION

From https://www.eventbrite.com/e/finaglemeetup-at-twitter-hq-tickets-12857666627

TRANSCRIPT

Page 1: Finagle-Based Microservices at SoundCloud

Finagle-Based Microservices at SoundCloud

Phil Calçado http://philcalcado.com

@pcalcado

Quick Report:

Page 2: Finagle-Based Microservices at SoundCloud
Page 3: Finagle-Based Microservices at SoundCloud
Page 4: Finagle-Based Microservices at SoundCloud

> 11 hours of audio uploaded every minute

~ 300 million people every month

Page 5: Finagle-Based Microservices at SoundCloud

Like everybody else around that time…

Page 6: Finagle-Based Microservices at SoundCloud

Like everybody else around that time…

Page 7: Finagle-Based Microservices at SoundCloud

Because ${reasons}, we decided to break the monolith. But how?

Page 8: Finagle-Based Microservices at SoundCloud

The Mothership

SoundCloud.com

Page 9: Finagle-Based Microservices at SoundCloud

The Mothership

Sounds ˝& Sets

Social Graph

Premium ˝Features Search

Activity Stream

API

Page 10: Finagle-Based Microservices at SoundCloud

Reminds me of something…

Page 11: Finagle-Based Microservices at SoundCloud

Monoliths exist when building within it is cheaper than the overhead associated with coordination of multiple components. !

!

Page 12: Finagle-Based Microservices at SoundCloud

We need an inexpensive services framework

Page 13: Finagle-Based Microservices at SoundCloud

Realistic options

Page 14: Finagle-Based Microservices at SoundCloud

Summary in a picture

Page 15: Finagle-Based Microservices at SoundCloud

Phase 1: Finatra

Page 16: Finagle-Based Microservices at SoundCloud
Page 17: Finagle-Based Microservices at SoundCloud

Good stuff

• Model is very intuitive to people coming from other languages

• Production-ready service in minutes

Page 18: Finagle-Based Microservices at SoundCloud

Main issues we had

• Not always on latest Finagle version

• Doesn't compose with Filters

• Internals aren’t very flexible

• twitter-server is too far away from our infra

Page 19: Finagle-Based Microservices at SoundCloud

Phase 2: Filters and Services

Page 20: Finagle-Based Microservices at SoundCloud

Where the gold was

Page 21: Finagle-Based Microservices at SoundCloud

We followed suit

(114 LOC)

Page 22: Finagle-Based Microservices at SoundCloud

Routes are defined in a single file

Page 23: Finagle-Based Microservices at SoundCloud

Each controller is a Service

Page 24: Finagle-Based Microservices at SoundCloud

Lots of filters

Page 25: Finagle-Based Microservices at SoundCloud

Today

• 100% Traffic hitting Finagle-based services

• Redis, memcached, MySQL drivers used in production

• About one month to ramp-up non-Scala developers

Page 26: Finagle-Based Microservices at SoundCloud

What is still hard

• Config flags implementation isn't very flexible, we use env vars not properties

• API surface space for Finagle is too large. What’s user land, what’s test, what’s internal?

• Bespoke scatter-gather code all over our apps

• Every organization builds their own Finagle routing

Page 27: Finagle-Based Microservices at SoundCloud

Up next

Page 28: Finagle-Based Microservices at SoundCloud

Containers for Continuous Delivery

Page 29: Finagle-Based Microservices at SoundCloud

Thrift/Protocol Buffers?

}JSON parsing?

Page 30: Finagle-Based Microservices at SoundCloud

phil calçado

www.soundcloud.com

http://philcalcado.com

@pcalcado

http://soundcloud.com/pcalcado