$30 off During Our Annual Pro Sale. View Details »

Evolution of Architecture @ Kauche

Yuki Ito
September 04, 2022

Evolution of Architecture @ Kauche

Yuki Ito

September 04, 2022
Tweet

More Decks by Yuki Ito

Other Decks in Technology

Transcript

  1. Evolution of Architecture @ Kauche Yuki Ito (@mrno110)

  2. Kauche Architect Yuki Ito @mrno110

  3. None
  4. Agenda • Past ~ Present • Architecture • Microservices •

    Future • API Federation
  5. Agenda • Past ~ Present • Architecture • Microservices •

    Future • API Federation
  6. Architecture Run Tasks Pub/Sub Mobile App External Service Mobile API

    Web Hook API Job API Scheduler
  7. What is Cloud Run Cloud Run is a managed compute

    platform that enables you to run containers that are invocable via requests or events. Cloud Run is serverless: it abstracts away all infrastructure management... https://cloud.google.com/run/docs
  8. Architecture - Key Concepts - ɾEverything runs on Cloud Run

    ɾEverything runs as a API (gRPC)
  9. Architecture Run Tasks Pub/Sub Mobile App External Service Mobile API

    Web Hook API Job API Scheduler
  10. Architecture Run Tasks Pub/Sub Mobile App External Service Mobile API

    Web Hook API Job API Scheduler
  11. Architecture - Key Concepts - e.g.) VS. Cloud Functions Trigger

    Run Pub/Sub Functions Run Firestore Functions
  12. Architecture Run Tasks Pub/Sub Mobile App External Service Mobile API

    Web Hook API Job API Scheduler
  13. Architecture ✅ Everything is Managed as API De fi nitions

    ✅ Reuse same implementation logic as APIs ✅ Use same Monitoring environments
  14. Architecture ✅ Everything is Managed as API De fi nitions

    ✅ Reuse same implementation logic as APIs ✅ Use same Monitoring environments
  15. gRPC gRPC is a modern open source high performance Remote

    Procedure Call (RPC) framework that can run in any environment. https://grpc.io/
  16. gRPC 🧑💻

  17. Architecture: 2020 ~ Run Customer App Customer gRPC

  18. Architecture: 2021 ~ Run Customer App Customer gRPC / Partner

    gRPC Partner App
  19. Modular Monolith Almost all the cases where I've heard of

    a system that was built as a microservice system from scratch, it has ended up in serious trouble. ... you shouldn't start a new project with microservices, even if you're sure your application will be big enough to make it worthwhile. MonolithFirst Martin Fowler https://martinfowler.com/bliki/MonolithFirst.html
  20. Modular Monolith ✅ Pros - Single Deployment Unit - Simple

    Design ❌ Cons - Independence - Autonomy
  21. Architecture: 2022 ~ Run Customer App Customer gRPC Partner App

    Partner gRPC
  22. API Gateway Pattern Customer App Customer gRPC Partner App Partner

    gRPC API Gateway
  23. O ffl oading Cross-Cutting Concerns to the API Gateway ✓

    Authentication / Authorization ✓ Transcoding ✓ Being Internet facing (TLS / Domain / CDN / IP ...) ✓ ...
  24. API Gateway Pattern Customer App Customer gRPC Partner App Partner

    gRPC Envoy (API Gateway)
  25. Envoy https://www.envoyproxy.io/docs/envoy/v1.23.0/intro/what_is_envoy Envoy is an L7 proxy and communication bus

    designed for large modern service oriented architectures. The project was born out of the belief that:ɹ The network should be transparent to applications. When network and application problems do occur it should be easy to determine the source of the problem.
  26. Why Envoy? • Extensibility with WebAssembly • Dynamic Con fi

    gurations • Widely used in the Cloud Native World
  27. Why Envoy? • Extensibility with WebAssembly • Dynamic Con fi

    gurations • Widely used in the Cloud Native World
  28. Envoy Architecture https://www.envoyproxy.io/docs/envoy/latest/intro/life_of_a_request#http- fi lter-chain-processing

  29. HTTP Filters JWT Authentication RBAC Modify HTTP Headers Request

  30. HTTP Filters JWT Authentication RBAC Modify HTTP Headers Request

  31. Wasm Filter Compile

  32. proxy-wasm https://github.com/proxy-wasm/spec/blob/c8 ff 5a8ac7b18a65360fe8ab843a6291b8947682/docs/WebAssembly-in-Envoy.md

  33. e.g. Fetching access tokens from Google Cloud Metadata Server API

    Gateway Upstream Microservice Metadata Server Access Token Access Token Get Access Token Request
  34. Microserivces Customer App Customer gRPC Partner App Partner gRPC API

    Gateway
  35. from Single Service

  36. to Microservices

  37. Access Control

  38. Access Control - Cloud Run - • Access Control with

    IAM • Restricting Ingress
  39. Access Control with IAM

  40. Ingress Setting • all • internal-and-cloud-load-balancing • internal

  41. Ingress Setting all

  42. Ingress Setting internal-and-cloud-load-balancing

  43. Ingress Setting internal

  44. Network

  45. Network https://kauche.connpass.com/event/252043/

  46. Agenda • Past ~ Present • Architecture • Microservices •

    Future • API Federation
  47. Agenda • Past ~ Present • Architecture • Microservices •

    Future • API Federation
  48. Architecture: 2022 ~ Customer App Customer gRPC Partner App Partner

    gRPC API Gateway
  49. Architecture: 2022 ~ Customer App Customer gRPC Partner App Partner

    gRPC API Gateway
  50. Architecture: 2022 ~ Customer App Customer gRPC API Gateway

  51. Architecture: 2022 ~ Commerce gRPC Social gRPC API Gateway Customer

    App
  52. Single Aggregation Layer Commerce gRPC API Gateway Aggregation Layer Social

    gRPC
  53. Single Aggregation Layer ❌ Initiative ❌ Independence ❌ Autonomy

  54. GraphQL Federation Commerce gRPC API Gateway Social GraphQL Customer GraphQL

    Federation (Apollo Router) Commerce GraphQL Social gRPC
  55. GraphQL Federation Commerce GraphQL Social GraphQL + Customer GraphQL (Super

    Graph) (Rover CLI)
  56. GraphQL Federation Commerce gRPC API Gateway Social GraphQL Customer GraphQL

    Federation (Apollo Router) Commerce GraphQL Social gRPC
  57. GraphQL Federation Commerce gRPC API Gateway Social GraphQL Customer GraphQL

    Federation (Apollo Router) Commerce GraphQL Social gRPC Platfrom Business
  58. GraphQL Federation ✅ Initiative ✅ Independence ✅ Autonomy

  59. Agenda • Past ~ Present • Architecture • Microservices •

    Future • API Federation