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
Manage microservices like a Chef
Search
Mathieu Acthernoene
May 30, 2018
Technology
0
1.1k
Manage microservices like a Chef
Mathieu Acthernoene
May 30, 2018
Tweet
Share
More Decks by Mathieu Acthernoene
See All by Mathieu Acthernoene
Advanced TypeScript: How we made our router typesafe
zoontek
3
1.2k
Designing and maintaining an open-source React Native library
zoontek
0
100
Des apps multiplateformes avec reason-react-native
zoontek
0
79
Other Decks in Technology
See All in Technology
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
230
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
12
2k
Building Scalable Backend Services with Firebase
wisdommatt
0
110
Docker Desktop で Docker を始めよう
zembutsu
PRO
0
170
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
140
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
データ基盤におけるIaCの重要性とその運用
mtpooh
4
510
コロプラのオンボーディングを採用から語りたい
colopl
5
1.2k
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
CDKのコードレビューを楽にするパッケージcdk-mentorを作ってみた/cdk-mentor
tomoki10
0
210
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
200
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
RailsConf 2023
tenderlove
29
970
How to train your dragon (web standard)
notwaldorf
89
5.8k
4 Signs Your Business is Dying
shpigford
182
22k
The World Runs on Bad Software
bkeepers
PRO
66
11k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Designing for Performance
lara
604
68k
Automating Front-end Workflow
addyosmani
1366
200k
Fireside Chat
paigeccino
34
3.1k
Gamification - CAS2011
davidbonilla
80
5.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
Manage microservices like a Chef
Mathieu Acthernoene @zoontek
Microservices are awesome ✨
Microservices are awesome ✨ Each service is an app implementing
its own business logic service database SaaS 1 SaaS 2
Microservices are awesome ✨ Separated by concern, easier to understand
what's going on auth email sms …
Microservices are awesome ✨ They can evolve apart, deploy at
different frequencies service 1 service 2 service 3 service 4 service 1 service 4 service 4
Microservices are awesome ✨ If one breaks, you don't have
to reboot everything service 1 service 3 service 4
Microservices are awesome ✨ Scales according to the service needs,
not globally CPU intensive service RAM intensive service GPU intensive service
Microservices are awesome ✨ Each service team is free to
use the right tools service using couchDB service using JavaScript service using Golang
But
But
Just as you think you're making microservices
You might just not
You are not building microservices when… #
You are not building microservices when… # Changes needs to
be synced service 1 service 1 change service 2
Deploys needs to be synced You are not building microservices
when… # service 1 service 1 deploy service 2
The same developers work across a large number of them
service 1 Kévin Sylvie Amine You are not building microservices when… # service 2 Kévin Luc Clarisse service 3 Kévin Zhang Nicolas
They share a datastore You are not building microservices when…
# service 1 database service 2
They share a lot of the same code / models
You are not building microservices when… # service 1 type User {} service 2 type User {} service 3 type User {}
You just created a distributed monolith crypto REST logging REST
email REST sms REST storage REST billing REST
None
Managing microservices is like managing a restaurant
waiter REST sous-chef REST pastry chef REST wine waiter REST
washer REST chef REST
None
How does a restaurant manage services?
None
The “simple” gateway solution crypto REST logging REST email REST
sms REST storage REST billing REST gateway REST
One interlocutor passing messages to the right services
The REST / JSON gateway issues ⚠ If a first
API is RESTful, the twelfth iteration is RESTish service API v1 ✨ service API v3 … service API v9 …
Latency caused by serialization / deserialization service 1 service 2
API gateway decode JSON understand message create message encode JSON The REST / JSON gateway issues ⚠
You embed your model schemas in every messages { "login":
"octocat", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", … The REST / JSON gateway issues ⚠
As a service owner, you have to wait for a
complete implementation of another one to start using it service 1 is finished & deployed the API gateway implements service 1 service 2 starts implementing its usage of service 1 The REST / JSON gateway issues ⚠
As JSON types are basic (JavaScript interop…), a documentation is
mandatory The REST / JSON gateway issues ⚠
How does a restaurant manage communication?
None
People working in the kitchen don't necessarily have the same
mother tongue
They don't force their coworkers to use their language
Protobuf ↔
Protobuf ↔ Created by, and for Google in 2001
A binary format for typed exchanges Protobuf ↔
Protobuf ↔ Generate clients for C++, Java, Python, Go, Ruby,
C#, JS, ObjC, PHP, Dart…
Offers backward compatibility for free Protobuf ↔
Offers a JSON mapping Protobuf ↔
Tooling and linters are available Protobuf ↔
Allows RPC methods definition Protobuf ↔
How to write a .proto file
syntax = "proto3";
package storage;
import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto";
option java_package = "com.scaleway.storage";
message Bucket { enum Attributes { LAZY = 0; DELUXE
= 1; } string id = 1; google.protobuf.Timestamp created_at = 2; repeated Attributes attributes = 3; int32 old_field = 4 [deprecated=true]; }
service Storage { rpc ListBuckets(ListBucketsRequest) returns (stream Bucket) { option
(google.api.http) = { get: "/buckets" }; } rpc GetBucket(GetBucketRequest) returns (Bucket) { option (google.api.http) = { get: "/buckets/{id}" }; } } message ListBucketsRequest { string user_id = 1; } message GetBucketRequest { string id = 1; }
syntax = "proto3"; package storage; option java_package = "com.scaleway.storage"; service
Storage { rpc ListBuckets(ListBucketsRequest) returns (stream Bucket) { option (google.api.http) = { get: "/buckets" }; } rpc GetBucket(GetBucketRequest) returns (Bucket) { option (google.api.http) = { get: "/buckets/{id}" }; } } message Bucket { enum Attributes { LAZY = 0; DELUXE = 1; } string id = 1; google.protobuf.Timestamp created_at = 2; repeated Attributes attributes = 3; int32 old_field = 4 [deprecated=true]; } message ListBucketsRequest { string user_id = 1; } message GetBucketRequest { string id = 1; }
None
I get Protobuf, but what is gRPC ? HTTP/2 clients
for Protobuf messages transport
Unaries, uni- and bi-directional streams I get Protobuf, but what
is gRPC ?
Blocking & Non-Blocking messages I get Protobuf, but what is
gRPC ?
Authentification (per call, and TLS for trusted services) I get
Protobuf, but what is gRPC ?
Cancellation and timeout handling I get Protobuf, but what is
gRPC ?
Smart retries with backoff I get Protobuf, but what is
gRPC ?
Error handling with standardized status codes I get Protobuf, but
what is gRPC ?
Lameducking for graceful shutdowns I get Protobuf, but what is
gRPC ?
A huge ecosystem
A huge ecosystem Used by Google, Lyft, Uber, Square, Netflix,
CoreOS, Docker, Cockroachdb, Cisco, Juniper Networks…
A huge ecosystem Supported by nginx, kubernetes, envoy, etcd, istio…
A huge ecosystem A lot of middlewares available
A huge ecosystem A HTTP+JSON interface available
A new service is created protos monorepo crypto gRPC logging
gRPC email gRPC sms gRPC storage gRPC billing gRPC service discovery ML gRPC
And for the front-end?
How does a restaurant expose services to a client?
None
GraphQL
A request example (developer.github.com/v4/explorer)
dashboard CLI API gateway mobile app GraphQL adapter protos monorepo
crypto gRPC gRPC logging gRPC email gRPC sms gRPC storage gRPC billing gRPC service discovery gRPC REST
None
Keep in mind that there's no silver bullet
This technologies allow you to create a factory of products
/ services
Thank you! Questions?