Share
Embed
[mercari GEARS 2025] Building Foundation for Mercari’s Global Expansion
Transcript
67 slides
-
deeeeeeet Leading global expansion initiative. Before moving to
XB, he was a Director of Platform Engineering, leading the Platform Engineering team and SRE team. Prior to Mercari, he was a software engineer at a Japanese e-commerce company, working on building and operating internal PaaS. VP of XB Engineering Hi, I’m deeeeeeeeeet! Please fix me! -
Overseas buyers Domestic sellers Proxy Partner ①Request
purchase ②Buy on Mercari ③Ship to domestic warehouse ④Ship to oversea Crossborder transaction -
Overseas buyers Domestic sellers Proxy Partner ①Request
purchase ②Buy on Mercari ③Ship to domestic warehouse ④Ship to oversea Crossborder transaction -
Crossborder GMV trends FY2022.6 FY2025.6 FY2027.6 6 90 (Billion JPY)
15x growth over the past 3 years Approximately 70% of transactions are in the Entertainment & Hobbies category -
9 Previous approach: Start from local marketplace New
approach: Start with Cross border from JP -
Fork JP US JP system US system
UK UK system -
Fork JP US JP system US system
UK UK system 🔥 Higher cost of new expansion -
Fork JP US JP system US system
UK UK system 🔥 Higher cost of new expansion 🔥 Dev resource ineffiency -
JP TW HK X US
JP system US system Global Foundation -
Transform? Rebuild JP JP system TW HK
X Global Foundation Fork? -
Transform? Rebuild JP JP system TW HK
X Global Foundation Fork? -
Transform? Rebuild JP JP system TW HK
X Global Foundation Fork? -
Transform? Rebuild JP JP system TW HK
X Global Foundation Fork? -
Transform + Depend Rebuild JP JP system TW
HK X Global Foundation Platform Transform? Fork? -
JP TW HK X Global Foundation
Platform -
🔥 Different microservices + frequent org changes 🔥
Nano-services across different teams Microservcices -
Modular monolith ✅ Clear / Strong boundaries ✅ Consistent
Implement Pattern + Flexible assignments -
Modular monolith ✅ Clear / Strong boundaries ✅ Consistent
Implement Pattern + Flexible assignments ✅ Monolith DX = Simple DX -
• Design for two • Global by default but
enable localization • Enable quick iteration • Utilize the existing foundation and platform • Learn and unlearn from the past experience • Keep each country's business isolated • … -
🔥1 → 2: Higher costs ✅ 2 → 3:
Less costs -
🔥1 → 2: Higher costs ✅ 2 → 3:
Less costs -
• Design for two • Global by default but
enable localization • Enable quick iteration • Utilize the existing foundation and platform • Learn and unlearn from the past experience • Keep each country's business isolated • … -
yanolab Since joining Mercari in 2019, I worked
on logistics development, developer experience, and infrastructure. Currently serving as an architect and SRE on the Cross Border team, focusing on system infrastructure for global expansion. Software Engineer -
Agenda Background of choosing Modular Monolith 1 Introducing our Modular
Monolith Approach 2 Approach to Increasingly Complex Domains and Dependencies 3 Challenges and Future Work 4 -
Background: Why Modular Monolith Established Rich Ecosystem • Comprehensive
tooling: application boilerplate, Go SDK, Terraform starter kit, etc. • Quality management process with Production Readiness Check (PRC) Emerging Challenges • Ecosystem complexity → Increased learning cost • PRC expansion → Minimum 3 months required to launch a single Microservice Maturity and Limitations of Microservice Ecosystem -
Background: Why Modular Monolith Reality of New Business Development
• Small teams need to manage dozens of Microservices • Required effort: Number of Microservices × 3 months = Unrealistic timeline Resulting Trend • Recent new businesses increasingly adopt Monolith-like approaches Challenges in Launching New Businesses -
Background: Why Modular Monolith Expected Scale • Anticipated to
grow to the same scale as the current Mercari Marketplace What We Need • Leverage existing ecosystem while maintaining operational flexibility • Balance between initial development speed and future scalability Requirements for Global Expansion -
Modular Monolith Flexibility Everything in Configuration Protocol Buffer +
gRPC Maintainability Tier Concept Code + Module Ownership Efficiency Local Environment Cross Collaboration -
Flexibility: Modular Monolith with Flexible Deployment Protocol Buffer and gRPC/Connect
RPC • Internal/External module communication uses Protocol Buffer and gRPC/Connect RPC Managing Environment Differences with CUE Lang • Each module can be enabled or disabled via configuration • Module connections and settings are fully configurable • Only environment-specific differences can be managed -
Flexibility: Modular Monolith with Flexible Deployment module module module module
BFF Monolith(one binary) module module Deployment B module module BFF Deployment A configurable Separate gRPC request -
Run-Time Build-Time Flexibility: Modular Monolith with Flexible Deployment production development
default config local Pull Request e2e GKE GKE Only Diff Only Diff CUE/YAML GKE CUE/YAML Deployment -
Maintainability: Single Binary and DB Isolation Single Binary for Server,
Worker and Single Binary for Batch • Switch feature on deployment by configuration • Code owners can be assigned per module to ensure ownership separation Separate Service Account and Database per modules • Each module owns its own independent service account and database -
Maintainability: Single Binary and DB Isolation User Module Product Module
Social Module AlloyDB Cluster SA SA SA -
Maintainability: Tier Cocept There are hundreds services in Mercari and
Merpay Service Map -
Maintainability: Tier Cocept Item Product Category Brand Comment Social Message
Like Organized service boundary and rebuilt services -
Maintainability: Tier Cocept Module is categorized by Tier •
BFF/Gateway ◦ Client optimization, language/currency conversion ▪ Co-owned by Mobile/Web/Backend engineers • Tier1 ◦ Request orchestration ▪ Horizontal: Building processes by combining multiple functionalities • Tier2 ◦ Marketplace core functionalities (Product, Order, etc.) ▪ Vertical: Domain-specific processing • Tier3 ◦ Marketplace-agnostic generic functionalities (Search, Notification, etc.) • Tier4 ◦ Modules with special security/operational requirements (Personal information, etc.) -
Maintainability: Tier Cocept Order Management Shopping Management BFF A Product
Order Social Tier 1 Tier 2 Tier 3 Search Notification Tier 4 PII BFF/Gateway Gateway B Request Flow -
Efficiency: Local Development and Cross Collaboration Single Binary •
Easy to build local development without Docker Compose • Easy to debug using debugger • Use mirrord¹ with actual Kubernetes Environment • Use Air² for dynamic loading Cross Collaboration • Easy to align application code and make it understanding easy • Engineers can develop any modules without extra communication ¹: https://metalbear.com/mirrord ²: https://github.com/air-verse/air -
Current Challenges Release Flow • We want to achieve
fast deployment ◦ Merge into main as release but it causes unexpected merge or conflict Future Development • Make streamline the Monorepo/Modular Monolith approach for faster adoption across Mercari's new business • Reduce initial setup costs to enable rapid business launches in the AI-driven development era -
Blog Series Behind the Scenes of Developing Mercari’s First Global
App, “Mercari Global App” https://engineering.mercari.com/en/blog/entry/20251003-mercari-crossborder/