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
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
170
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
160
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
1
110
kargoの魅力について伝える
magisystem0408
0
200
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
670
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
250
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
Qiita埋め込み用スライド
naoki_0531
0
860
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
160
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Making Projects Easy
brettharned
116
5.9k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Building Applications with DynamoDB
mza
91
6.1k
Bash Introduction
62gerente
608
210k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
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?