Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Containerizing your monolith
Search
Jano González
October 30, 2019
Programming
0
380
Containerizing your monolith
My presentation @ LISA19
Jano González
October 30, 2019
Tweet
Share
More Decks by Jano González
See All by Jano González
Migrando a Microservicios
janogonzalez
1
300
Extracting services from a monolith
janogonzalez
3
250
¿Después de 10 años, realmente entiendo esta industria?
janogonzalez
3
470
Microservices in Practice
janogonzalez
7
670
Two programmers in one
janogonzalez
1
170
The Bipolar Programmer
janogonzalez
4
610
Ruby for your two internal programmers
janogonzalez
4
250
Ruby for Java minds
janogonzalez
4
1.1k
How Ruby Programmed Me
janogonzalez
11
500
Other Decks in Programming
See All in Programming
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
510
Is Xcode slowly dying out in 2025?
uetyo
1
270
Discover Metal 4
rei315
2
130
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
220
A2A プロトコルを試してみる
azukiazusa1
2
1.4k
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
12
4.4k
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
650
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
640
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
10k
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
770
ふつうの技術スタックでアート作品を作ってみる
akira888
1
840
ニーリーにおけるプロダクトエンジニア
nealle
0
830
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.7k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
820
RailsConf 2023
tenderlove
30
1.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
How to train your dragon (web standard)
notwaldorf
95
6.1k
Transcript
Containerizing your monolith Jano González (@janogonzalez)
Introduction
What’s SoundCloud
> 200M Tracks > 20M Creators Many SoundCloud Rappers What’s
SoundCloud
2017-2018 Migration Keep moving Motivation
What’s the balance? Motivation
Our migration to microservices The monolith Containerizing the monolith Conclusion
Contents
Our migration to microservices
$ rails new soundcloud How we started
Around 2012
Around 2012
Around 2012
Around 2012
After
After
But what about deployment?
Component Environment Zone Deployment Our abstractions
Deployment The process
The monolith
Track User Playlist The monolith Core entities
360 Chef provisioned bare-metal machines Rails 2.3 Capistrano deployment The
monolith The technology
The monolith The architecture Public API Internal API Public API
Strangler Internal API caching/ strangler Another BFF Many microservices Public Web Workers
The monolith The components Public API MoshiMoshi (Internal API) Public
Web Assets MoshiMoshi Comments (Internal API) Workers Cron Shell Migration
The monolith The hosts component statsd-exporter mtail statsd passenger- exporter
…
Utilization Deployment Lack of confidence The monolith The issues
Containerizing the monolith
Throw it into Kubernetes
Congrats, your monolith is a microservice now
Thank You!
1.5 Engineers 1 year until the last bit was cleaned
up The project
The first milestone
Docker development container Tests on GoCD The first milestone
The proof of concept
First staging component The proof of concept Does it even
work?
The proof of concept PR O BLEM ! Init script
Nginx Passenger Passenger Process Rails App ??? Where are my env variables?
The proof of concept Env variables with The Perl Hack™
SO LU TIO N
Productionizing
Deployment Monitoring Logs Productionizing Does it run where it matters?
Productionizing Anatomy of a traffic serving pod component statsd statsd-exporter
passenger- exporter mtail twemproxy twemproxy-cu twemproxy- exporter init
Don’t choke service discovery Be allocatable Productionizing Sizing the pods
CPU units for main container Passenger processes Productionizing Sizing the
pods 3 16
Productionizing PR O BLEM ! Stdout v/s the log metrics
exporter Component STDOUT Log aggregator File??? Mtail
Productionizing Mtail with The Rotatelogs Hack™ SO LU TIO N
Productionizing Public API
Orchestration Productionizing Public API
Productionizing Public API PR O BLEM ! DNS latency and
our excessive usage Component Service Service Service
Productionizing Public API CoreDNS and the DNS Hack™ SO LU
TIO N
Productionizing Internal API
Highest throughput Productionizing Internal API
Productionizing Internal API PR O BLEM ! Latency was too
high
Productionizing Internal API Optimize GC and make cheaper SQL queries
SO LU TIO N
Productionizing Internal API PR O BLEM ! Errors spikes during
deployment
Productionizing Internal API The preStop Trick™ SO LU TIO N
Productionizing Internal API PR O BLEM ! Errors spikes during
deployment (still???)
Productionizing Internal API The Pre Start Trick™ SO LU TIO
N
The rest
• Workers • Cron jobs • Shell / Migration hosts
• Cleanup! The rest
Finishing
Current status
On-prem Cloud Current status Number of pods ~1000 ~140
On-prem RPS Cloud RPS Current status Traffic 25K 3K
Current status Many deploys
Conclusions
One Infrastructure One Delivery Process Conclusions What we solved
Step by step Controlled rollouts Managing expectations Conclusions How we
did it
Improved utilization Increased confidence Enabling new initiatives Conclusions Benefits
Assess current progress Evaluate costs and benefits Conclusions Should you
do it?
Thank You!
@janogonzalez https://soundcloud.com/janogonzalez