Micoservices Platform in Mercari

8238c3c0be55b887aa9d6d59bfefa504?s=47 BABAROT
August 15, 2018

Micoservices Platform in Mercari

8238c3c0be55b887aa9d6d59bfefa504?s=128

BABAROT

August 15, 2018
Tweet

Transcript

  1. Backend Engineer Drink Meetup #2 Aug 15, 2018 / @b4b4r07

    Microservices Platform in Mercari
  2. @b4b4r07 / babarot Blog / tellme.tokyo SRE in Microservices Platform

    Team at Mercari, Inc.
  3. Why Mercari Choose Microservices

  4. 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
  5. 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
  6. What are Microservices?

  7. 7 • Simpler to deploy / Easy to understand •

    Reusability across business • Faster defect isolation • Minimize the risk of code changes What are Microservices?
  8. 8 • Autonomous ◦ (Units that can be deployed independently)

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

    ◦ Isolate perspective: ▪ Data consistency and transaction boundaries ▪ Team, Technology, Cohesion, Security, ... What are Microservices?
  10. 10 Development in Monolith Develop Monolith QA Deploy Operate QA

  11. 11 Development in Monolith Develop Monolith QA Deploy Operate QA

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

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

    team SRE team QA Backend Team A Backend Team B Backend Team C
  14. 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
  15. 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
  16. Why Microservices Platform

  17. 17 • Two reasons why Platform is required ◦ Team

    side ◦ System side Why Microservices Platform
  18. 18 Why Platform is required: Team side

  19. 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
  20. 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
  21. 21 Why Platform is required: System Side

  22. 22 Monolithic App Data Access Layer Business Logic UI Database

  23. 23 Monolithic App Data Access Layer Business Logic UI Database

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

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

    Microservices Apps Units that can be deployed independently
  26. 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
  27. Microservices Platform

  28. 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
  29. 29

  30. 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
  31. 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
  32. • 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
  33. Technical Stacks

  34. None
  35. None
  36. None
  37. Work In Progress

  38. Work In Progress

  39. None