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
Cookpad and Microservices
Search
taiki45
December 18, 2014
Programming
4
3.9k
Cookpad and Microservices
at 第1回 えびスタ! ~ 恵比寿スタートアップ勉強会 ~
http://ebista.connpass.com/event/10258/
taiki45
December 18, 2014
Tweet
Share
More Decks by taiki45
See All by taiki45
RustでAWS Lambda functionをいい感じに書く
taiki45
1
250
SPIFFE Meetup Tokyo #2 LT: Envoy SDS
taiki45
0
570
builderscon Tokyo 2019: Intro Service Mesh
taiki45
6
3k
NoOps Meetup Tokyo #7: 入門サービスメッシュ
taiki45
4
1.7k
CloudNative Days Tokyo 2019: Understanding Envoy
taiki45
3
3.2k
Cloud Native Meetup Tokyo #8 ServiceMesh Day Recap
taiki45
2
300
EnvoyCon 2018: Building and operating service mesh at mid-size company
taiki45
4
4.3k
Cookpad Tech Kitchen #20 クックパッドでのサービスメッシュについて
taiki45
1
2.2k
Building and operating service mesh at mid-size company
taiki45
2
2.2k
Other Decks in Programming
See All in Programming
有効な使い方を正しく理解して実装する PHP8.3の最新機能 / Proper understanding and implementation of effective usage Latest features in PHP 8.3
seike460
PRO
2
230
The Hotwire Landscape After Turbo 8 @ Brighton Ruby 2024
marcoroth
2
230
設計の考え方 - インターフェースと腐敗防止層編 #phpconfuk / Interface and Anti Corruption Layer
okashoi
8
1.7k
【超難問】絶対に解けないJavaScriptクイズ8選
tomo1227
0
2.2k
Breaking the Ceiling: Scaling Your Impact at the Staff-Plus Level (InfoQ-DevSummit-Boston)
thiagoghisi
0
150
プラットフォームエンジニアリングを 普及と実践し続けて見えてきた利点とリスク
zawa_zawa0210
2
4.7k
Using Next.js as a full-stack framework / Next.jsをフルスタックフレームワークとして使ってみた
mongolyy
PRO
1
170
Google Cloud で プロダクト開発 事業として成長させるZennの例 / grows-zenn-with-google-cloud
wadayusuke
3
290
CSC307 Lecture 02
javiergs
PRO
0
330
【Go言語】ジェネリクス
tomo1227
0
120
奥が深いメールのシステム / The depth of Email system
linyows
3
240
terraform-provider-aws にプルリクして マージされるまで
exoego
2
200
Featured
See All Featured
KATA
mclloyd
18
12k
The Illustrated Children's Guide to Kubernetes
chrisshort
36
47k
How to train your dragon (web standard)
notwaldorf
78
5.4k
Practical Orchestrator
shlominoach
184
9.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
651
58k
A Tale of Four Properties
chriscoyier
154
22k
Faster Mobile Websites
deanohume
301
30k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Code Review Best Practice
trishagee
57
16k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
Being A Developer After 40
akosma
68
580k
Transcript
Cookpad and Microservices Why and how we move to Microservices
architecture style
Taiki Ono • @taiki45 • Joined Cookpad at 2014/3 •
Dev-Infra group • Working with service integration related things and Web API
Sponsored by
Hi, we are Cookpad
None
over 50M users/month over 1.8M recipes
Not only recipe site…
None
None
None
You can see more products!
To make everyday cooking fun.
Why Microservices?
• Environment changes • Limit of Monolithic
• Environment changes • Limit of Monolithic
Our business changes
User agent changes
• Environment changes • Limit of Monolithic
A huge Rails app +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines |
LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 46173 | 37194 | 493 | 3754 | 7 | 7 | | Helpers | 14251 | 11687 | 13 | 1367 | 105 | 6 | | Models | 10153 | 7799 | 319 | 1152 | 3 | 4 | | Mailers | 402 | 326 | 16 | 35 | 2 | 7 | | Javascripts | 40217 | 34405 | 36 | 4940 | 137 | 4 | | Libraries | 2341 | 1833 | 112 | 252 | 2 | 5 | | Async_view specs | 247 | 212 | 0 | 0 | 0 | 0 | | Controller specs | 58856 | 48671 | 7 | 121 | 17 | 400 | | Feature specs | 40886 | 33590 | 0 | 196 | 0 | 169 | | Helper specs | 4151 | 3396 | 1 | 10 | 10 | 337 | | Lib specs | 22537 | 18817 | 27 | 128 | 4 | 145 | | Mailer specs | 421 | 346 | 0 | 0 | 0 | 0 | | Model specs | 71128 | 58668 | 4 | 70 | 17 | 836 | | Policy specs | 1487 | 1219 | 0 | 0 | 0 | 0 | | Request specs | 34595 | 29677 | 0 | 12 | 0 | 2471 | | Routing specs | 661 | 533 | 0 | 0 | 0 | 0 | | View specs | 619 | 508 | 0 | 2 | 0 | 252 | | Worker specs | 862 | 715 | 0 | 1 | 0 | 713 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 349987 | 289596 | 1028 | 12040 | 11 | 22 | +----------------------+-------+-------+---------+---------+-----+-------+
Slow test issue
RRRSpec solved
Slow deployment
mamiya solved
and some difficulties like scaling, upgrading Rails, etc…
We can’t control our own application.
We've found Microservices while we were challenging these issues.
Microservices
–James Lewis & Martin Fowler “an approach to developing a
single application as a suite of small services” IUUQNBSUJOGPXMFSDPNBSUJDMFTNJDSPTFSWJDFTIUNM
Build around business capabilities
None
Own process and lightweight messaging
HTTP JSON REST
Decentralization and polyglot
Ruby + MySQL Go + Redshift Java + MySQL
Characteristics of Microservices • Build around business capabilities • Own
process and lightweight messaging • Decentralization and polyglot
We can handle our own application, by paying cost of
complexity as a whole.
In Cookpad What we did?
Published service data
Garage Garage Garage Rails app
Garage and garage-client • RESTful hyper-media API • JSON message
enveloped in HTTP • Implemented as a Rails extension • Standardized communication pattern
Solutions for product common problems
º
̋
Backend products • Auth server (OAuth2.0) • Personal information server
• Notification base • Video backend
Data synchronization between products
Pub-Sub Topic
Pub-Sub Topic
Ping • Pub-Sub pattern • Implemented as a Rails extension
• A thin wrapper of Amazon SNS and fluentd • Receive events via webhook
What we did are… • Published product data with Garage
• Built some backend products • Built Ping for data synchronization
We are challenging more problems around Microservices
Join us!! http://recruit.cookpad.com/