Manage microservices like a Chef

Manage microservices like a Chef

Be03847a223c7afbad30c4993ea61a6e?s=128

Mathieu Acthernoene

May 30, 2018
Tweet

Transcript

  1. 4.

    Microservices are awesome ✨ Each service is an app implementing

    its own business logic service database SaaS 1 SaaS 2
  2. 6.

    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
  3. 7.

    Microservices are awesome ✨ If one breaks, you don't have

    to reboot everything service 1 service 3 service 4
  4. 8.

    Microservices are awesome ✨ Scales according to the service needs,

    not globally CPU intensive service RAM intensive service GPU intensive service
  5. 9.

    Microservices are awesome ✨ Each service team is free to

    use the right tools service using couchDB service using JavaScript service using Golang
  6. 10.

    But

  7. 11.

    But

  8. 15.

    You are not building microservices when… # Changes needs to

    be synced service 1 service 1 change service 2
  9. 16.

    Deploys needs to be synced You are not building microservices

    when… # service 1 service 1 deploy service 2
  10. 17.

    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
  11. 19.

    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 {}
  12. 20.

    You just created a distributed monolith crypto REST logging REST

    email REST sms REST storage REST billing REST
  13. 21.
  14. 24.
  15. 26.
  16. 27.

    The “simple” gateway solution crypto REST logging REST email REST

    sms REST storage REST billing REST gateway REST
  17. 29.

    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 …
  18. 30.

    Latency caused by serialization / deserialization service 1 service 2

    API gateway decode JSON understand message create message encode JSON The REST / JSON gateway issues ⚠
  19. 31.

    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 ⚠
  20. 32.

    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 ⚠
  21. 33.

    As JSON types are basic (JavaScript interop…), a documentation is

    mandatory The REST / JSON gateway issues ⚠
  22. 35.
  23. 51.

    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]; }
  24. 52.

    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; }
  25. 53.

    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; }
  26. 54.
  27. 55.

    I get Protobuf, but what is gRPC ? HTTP/2 clients

    for Protobuf messages transport
  28. 64.

    A huge ecosystem Used by Google, Lyft, Uber, Square, Netflix,

    CoreOS, Docker, Cockroachdb, Cisco, Juniper Networks…
  29. 68.

    A new service is created protos monorepo crypto gRPC logging

    gRPC email gRPC sms gRPC storage gRPC billing gRPC service discovery ML gRPC
  30. 71.
  31. 72.
  32. 74.

    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
  33. 75.