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
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
96
Des apps multiplateformes avec reason-react-native
zoontek
0
77
Other Decks in Technology
See All in Technology
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
210
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
170
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
510
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
AGIについてChatGPTに聞いてみた
blueb
0
130
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
1
250
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
360
TypeScript、上達の瞬間
sadnessojisan
46
13k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
560
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Building Your Own Lightsaber
phodgson
103
6.1k
The Pragmatic Product Professional
lauravandoore
31
6.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
RailsConf 2023
tenderlove
29
900
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Adopting Sorbet at Scale
ufuk
73
9.1k
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?