Slide 1

Slide 1 text

Backend Engineer Drink Meetup #2 Aug 15, 2018 / @b4b4r07 Microservices Platform in Mercari

Slide 2

Slide 2 text

@b4b4r07 / babarot Blog / tellme.tokyo SRE in Microservices Platform Team at Mercari, Inc.

Slide 3

Slide 3 text

Why Mercari Choose Microservices

Slide 4

Slide 4 text

4 ● To scale the service more than ever ○ * (Code base is getting bigger and complex day by day...) ○ Make it easy to try new feature / technology ○ Make it easy to catch up the service logic / domain ○ Cut down on-boarding cost ○ Speed up the deployment cycle ■ Reduce coordination with other teams Why Mercari choose Microservices

Slide 5

Slide 5 text

5 ● Fault Tolerance / Resilience ○ As the service grows, some features become important components that should not be down (e.g. Timeline) ○ Do not spread system failure to the whole ○ Cut down operation cost Why Mercari choose Microservices

Slide 6

Slide 6 text

What are Microservices?

Slide 7

Slide 7 text

7 ● Simpler to deploy / Easy to understand ● Reusability across business ● Faster defect isolation ● Minimize the risk of code changes What are Microservices?

Slide 8

Slide 8 text

8 ● Autonomous ○ (Units that can be deployed independently) ○ Isolate perspective: ■ Data consistency and transaction boundaries ■ Team, Technology, Cohesion, Security, ... What are Microservices?

Slide 9

Slide 9 text

9 ● Autonomous ○ (Units that can be deployed independently) ○ Isolate perspective: ■ Data consistency and transaction boundaries ■ Team, Technology, Cohesion, Security, ... What are Microservices?

Slide 10

Slide 10 text

10 Development in Monolith Develop Monolith QA Deploy Operate QA

Slide 11

Slide 11 text

11 Development in Monolith Develop Monolith QA Deploy Operate QA Backend Team A Backend Team B Backend Team C

Slide 12

Slide 12 text

12 Development in Monolith Develop Monolith QA Deploy Operate QA Backend Team A Backend Team B Backend Team C QA team

Slide 13

Slide 13 text

13 Development in Monolith Develop Monolith QA Deploy Operate QA team SRE team QA Backend Team A Backend Team B Backend Team C

Slide 14

Slide 14 text

14 Development in Microservices Develop Service B QA Deploy Operate QA team SRE team Service Team A Service Team B Service Team C Develop Service A Develop Service C

Slide 15

Slide 15 text

15 Development in Microservices Develop Service B QA Deploy Operate Service Team A Service Team B Service Team C Develop Service A Develop Service C QA Deploy Operate QA Deploy Operate

Slide 16

Slide 16 text

Why Microservices Platform

Slide 17

Slide 17 text

17 ● Two reasons why Platform is required ○ Team side ○ System side Why Microservices Platform

Slide 18

Slide 18 text

18 Why Platform is required: Team side

Slide 19

Slide 19 text

19 Develop Monolith QA Deploy Operate QA Backend Team A Backend Team B Backend Team C Develop Service B QA Deploy Operate Service Team A Service Team B Service Team C Develop Service A Develop Service C QA Deploy Operate QA Deploy Operate

Slide 20

Slide 20 text

20 Develop Monolith QA Deploy Operate QA Backend Team A Backend Team B Backend Team C Develop Service B QA Deploy Operate Service Team A Service Team B Service Team C Develop Service A Develop Service C QA Deploy Operate QA Deploy Operate New team responsibility

Slide 21

Slide 21 text

21 Why Platform is required: System Side

Slide 22

Slide 22 text

22 Monolithic App Data Access Layer Business Logic UI Database

Slide 23

Slide 23 text

23 Monolithic App Data Access Layer Business Logic UI Database Microservices Apps Units that can be deployed independently

Slide 24

Slide 24 text

24 Monolithic App Data Access Layer Business Logic UI Database Microservices Apps Units that can be deployed independently

Slide 25

Slide 25 text

25 Monolithic App Data Access Layer Business Logic UI Database Microservices Apps Units that can be deployed independently

Slide 26

Slide 26 text

26 Why Platform is required: System side ● Bootstrap & Provision cost ○ In case of Monolith, ■ the infra can be used for every features (reusability) ○ Unlike Monolith, ■ need to build the infra for each micro service

Slide 27

Slide 27 text

Microservices Platform

Slide 28

Slide 28 text

28 Microservices Platform ● Centralized GKE Cluster ○ 1 cluster per 1 region ● Cloud resources for each microservice ○ GCP Projects (Cloud SQL, Spanner, etc.) ○ PagerDuty ○ Datadog Dashboard

Slide 29

Slide 29 text

29

Slide 30

Slide 30 text

30 GCP project for GKE Centralized cluster Namespace: Service A Namespace: Service B IAM: SRE IAM: Team A IAM: Team B Service A Service B RBAC: Team A RBAC: Team B

Slide 31

Slide 31 text

31 GCP project for GKE Centralized cluster Namespace: Service A Namespace: Service B IAM: SRE IAM: Team A Service A Service B RBAC: Team A RBAC: Team B Bootstrap Bootstrap IAM: Team B

Slide 32

Slide 32 text

● Microservice Starter Kit ○ It became easy for the developers to bootstrap own infrastructure by themselves ○ Just by running 1 command locally, all resources needed for their microservice are created

Slide 33

Slide 33 text

Technical Stacks

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Work In Progress

Slide 38

Slide 38 text

Work In Progress

Slide 39

Slide 39 text

No content