Evolution of Beike Mini‑Program Backend Platform: From PHP to Golang, Microservices, and Cloud‑Native Architecture
The article details the progressive transformation of Beike's mini‑program backend—from rapid PHP prototyping to Golang‑based gateways, microservice decomposition, Redis and TiDB optimizations, and cloud‑native stability measures—illustrating how performance, scalability, and platform‑wide capabilities were systematically enhanced.
Beike's mini‑program has amassed nearly 200 million users, prompting the team to continuously evolve the platform to deliver greater value to the housing industry.
Initially built in 2018 with a fast‑track PHP backend, the 1.0 version focused on rapid API development and functional delivery. Performance monitoring, daily reports, and real‑time alerts were introduced to keep the service stable.
Facing sudden traffic spikes from the WeChat "nine‑grid" launch, the team identified Redis memory pressure as a bottleneck. By compressing large JSON values and using persistent connections, memory usage was halved and latency improved.
Core services such as sharing, messaging, and agent‑user relationship tracking were established, enabling detailed behavior analytics and future C2C marketing opportunities.
In the 2.0 era, the backend migrated from PHP to Golang gateways. Golang's lightweight goroutine model and asynchronous logging allowed the gateway to sustain over 11,000 QPS with CPU usage below 40%, far surpassing the PHP baseline.
The architecture was expanded to include a clear five‑layer stack: platform gateway, business API, platform services, storage (MySQL, Redis, TiDB, Hive), and middle‑platform support.
Microservice adoption split the monolith into independent services, each with dedicated resources, improving isolation and scalability. Token management was automated, and search services were optimized with hot‑word caching.
Database scaling challenges were addressed by introducing TiDB, a cloud‑native distributed MySQL‑compatible store, delivering elastic expansion, high‑performance OLTP/OLAP, and seamless migration.
Stability engineering introduced flow control (go‑sentinel), rate limiting, circuit breaking, and API degradation strategies, ensuring graceful handling of traffic surges and service failures.
Future directions include finer‑grained domain‑driven microservices, enhanced traffic anomaly detection, and further consolidation of core platform capabilities.
Beike Product & Technology
As Beike's official product and technology account, we are committed to building a platform for sharing Beike's product and technology insights, targeting internet/O2O developers and product professionals. We share high-quality original articles, tech salon events, and recruitment information weekly. Welcome to follow us.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.