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
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
210
生成AIのガバナンスの全体像と現実解
fnifni
1
200
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
300
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
270
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
170
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
5
960
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
38
16k
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
130
.NET 9 のパフォーマンス改善
nenonaninu
0
1.2k
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
250
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
How to Ace a Technical Interview
jacobian
276
23k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Fireside Chat
paigeccino
34
3.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Building Your Own Lightsaber
phodgson
103
6.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Making Projects Easy
brettharned
116
6k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
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?