Slide 1

Slide 1 text

Evolution of Architecture @ Kauche Yuki Ito (@mrno110)

Slide 2

Slide 2 text

Kauche Architect Yuki Ito @mrno110

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

Architecture - Key Concepts - ɾEverything runs on Cloud Run ɾEverything runs as a API (gRPC)

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

Architecture - Key Concepts - e.g.) VS. Cloud Functions Trigger Run Pub/Sub Functions Run Firestore Functions

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

gRPC gRPC is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. https://grpc.io/

Slide 16

Slide 16 text

gRPC 🧑💻

Slide 17

Slide 17 text

Architecture: 2020 ~ Run Customer App Customer gRPC

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Modular Monolith ✅ Pros - Single Deployment Unit - Simple Design ❌ Cons - Independence - Autonomy

Slide 21

Slide 21 text

Architecture: 2022 ~ Run Customer App Customer gRPC Partner App Partner gRPC

Slide 22

Slide 22 text

API Gateway Pattern Customer App Customer gRPC Partner App Partner gRPC API Gateway

Slide 23

Slide 23 text

O ffl oading Cross-Cutting Concerns to the API Gateway ✓ Authentication / Authorization ✓ Transcoding ✓ Being Internet facing (TLS / Domain / CDN / IP ...) ✓ ...

Slide 24

Slide 24 text

API Gateway Pattern Customer App Customer gRPC Partner App Partner gRPC Envoy (API Gateway)

Slide 25

Slide 25 text

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.

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Envoy Architecture https://www.envoyproxy.io/docs/envoy/latest/intro/life_of_a_request#http- fi lter-chain-processing

Slide 29

Slide 29 text

HTTP Filters JWT Authentication RBAC Modify HTTP Headers Request

Slide 30

Slide 30 text

HTTP Filters JWT Authentication RBAC Modify HTTP Headers Request

Slide 31

Slide 31 text

Wasm Filter Compile

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

e.g. Fetching access tokens from Google Cloud Metadata Server API Gateway Upstream Microservice Metadata Server Access Token Access Token Get Access Token Request

Slide 34

Slide 34 text

Microserivces Customer App Customer gRPC Partner App Partner gRPC API Gateway

Slide 35

Slide 35 text

from Single Service

Slide 36

Slide 36 text

to Microservices

Slide 37

Slide 37 text

Access Control

Slide 38

Slide 38 text

Access Control - Cloud Run - • Access Control with IAM • Restricting Ingress

Slide 39

Slide 39 text

Access Control with IAM

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

Ingress Setting all

Slide 42

Slide 42 text

Ingress Setting internal-and-cloud-load-balancing

Slide 43

Slide 43 text

Ingress Setting internal

Slide 44

Slide 44 text

Network

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

Architecture: 2022 ~ Customer App Customer gRPC API Gateway

Slide 51

Slide 51 text

Architecture: 2022 ~ Commerce gRPC Social gRPC API Gateway Customer App

Slide 52

Slide 52 text

Single Aggregation Layer Commerce gRPC API Gateway Aggregation Layer Social gRPC

Slide 53

Slide 53 text

Single Aggregation Layer ❌ Initiative ❌ Independence ❌ Autonomy

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

GraphQL Federation Commerce GraphQL Social GraphQL + Customer GraphQL (Super Graph) (Rover CLI)

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

GraphQL Federation Commerce gRPC API Gateway Social GraphQL Customer GraphQL Federation (Apollo Router) Commerce GraphQL Social gRPC Platfrom Business

Slide 58

Slide 58 text

GraphQL Federation ✅ Initiative ✅ Independence ✅ Autonomy

Slide 59

Slide 59 text

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