Backend Development 21 min read

Architecture Evolution and Challenges of Meituan's Code Hosting Platform

This article details Meituan's Code platform evolution from a single‑machine setup to a multi‑machine and finally a distributed, sharded architecture, describing the scalability and availability challenges faced and the comprehensive engineering solutions implemented to achieve high‑performance, high‑availability code hosting for millions of repositories.

Architect
Architect
Architect
Architecture Evolution and Challenges of Meituan's Code Hosting Platform

Meituan's self‑developed Code platform manages millions of Git repositories and handles tens of millions of daily Git requests.

1. Evolution stages

Single‑machine deployment: simple web‑app serving all requests, limited by disk I/O.

Multi‑machine deployment: read‑write separation with a master node for writes and slave nodes for reads, round‑robin routing, and agent‑based sync, doubling read throughput.

Distributed architecture: application‑level sharding, three‑replica active‑active mode, gRPC communication, and logical‑physical separation via a routing service.

2. Key challenges

Scalability – storage saturation (80% SSD usage) and CPU/IO load >95% during peaks.

Availability – need for zero‑downtime upgrades, reliable backup, and cross‑region resilience.

3. Solution components

Proxy modules (SSH Proxy, HTTP Proxy) built with Go‑Crypto and Gin for request filtering, traffic control and seamless migration.

Routing (Shard) service maintaining repository‑to‑shard mapping, fast (<15 ms) gRPC lookups, read‑repair and strict arbitration (N=3, R=W=2).

Application services providing Git APIs, event hooks, and stateless scaling.

Storage layer based on GitLab components, with Replication Manager, Code Core, Git Core and Git Command Factory.

Active‑active three‑node Git clusters with multi‑region deployment, hot‑standby replication, and log compression (e.g., main -> a … compressed to main -> f ).

4. Operational practices

Data inspection, automatic hot‑backup, version‑based routing, and gradual migration tools ensure zero‑impact user experience.

5. Results and outlook

The platform now supports horizontal storage expansion, automatic load balancing, and high availability; future work will focus on automated operations, best‑practice tooling, and tighter code security integration.

scalabilityDistributed ArchitectureBackend Developmenthigh availabilitygitcode hosting
Architect
Written by

Architect

Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.