Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MTC2018 - Mercari API: from Monolithic to Micro...

mercari
October 04, 2018

MTC2018 - Mercari API: from Monolithic to Microservices

Speaker: Tonghui Li

Mercari has evolved tremendously in the last 5 years, and so is our code base. As of 2018, the backend API is a monolithic repository of half-million lines of code, serving all the functions of the Mercari web and mobile applications. It is becoming a bottle neck of our growth, in terms of both the system and the organization. This talk will focus on how we migrate the monolithic backend API to a microservice architecture, the methodology we choose and the lessons we learned.

mercari

October 04, 2018
Tweet

More Decks by mercari

Other Decks in Technology

Transcript

  1. • 500 KLOC • 100+ contributors • 100 PR /

    week Mercari API iOS Android web admin tools
  2. • 500 KLOC • 100+ contributors • 100 PR /

    week • And growing! Mercari API iOS Android web admin tools
  3. How to migrate to microservices • Implement new features in

    microservices • Break down existing API into multiple services
  4. API Gateway Service X Service Y Mercari API client SSL

    termination DDos protection Authn and Authz Traffic routing Logging and tracing
  5. Gateway Login Buy Sell Search Shipping ... User Item Photo

    Notification Address ... BFF Layer DAO Layer notf db user db item db s3
  6. How to migrate to microservices • Implement new features in

    microservices ◦ API Gateway ◦ Technical stack: Kubernetes, Go, gRPC, etc. • Break down existing API into multiple services ◦ Start from UX features ◦ Analyze fundamental components ◦ Split them into microservices
  7. Challenges: Testing With so many services, how do we test

    them? • Enforce unit tests coverage • Automated integration tests • Reduce manual QA process
  8. Challenges: DB DB is in Sakura but microservices are in

    GCP. • Run DAO layer services in Sakura • Migrate DB from Sakura to GCP • Create Tokyo DC and host DB / services in it