How 贝聊 Scaled from a Simple LNMP Stack to a Robust Microservices Architecture
This article chronicles the evolution of the 贝聊 platform from its early LNMP monolithic setup through a Java‑based distributed system to a full microservices architecture, highlighting the technical challenges, design decisions, and future plans such as containerization and API gateway implementation.
贝聊, founded in 2013, is a Chinese kindergarten‑parent communication platform backed by investors such as 威创股份, 清华启迪 and 网易, which quickly grew to millions of users, putting pressure on its original technical architecture.
Birth Phase – Architecture V1.0
In the startup stage, limited resources required a simple, easy‑to‑maintain architecture, leading to the adoption of a classic LNMP stack (Linux, Nginx, MySQL, PHP). The initial deployment used three ECS servers for Nginx, RDS, and Memcached.
Monolithic architecture with clear layered structure.
Fast development and iteration.
Low learning and operational costs.
The LNMP architecture supported the business for about a year and a half but began to reveal scalability and stability issues as the user base expanded.
Growth Phase – Architecture V2.0
In early 2015, the team of three engineers refactored the system to a Java‑based distributed architecture to address multiple pain points: tangled database design, mixed API logic, single‑point failures, and lack of service isolation.
The new V2.0 architecture introduced distributed deployment, system‑level service splitting, DB isolation with master‑slave replication, MQ for asynchronous processing, and SLB for load balancing.
Scalable distributed deployment.
System‑level splitting of business logic and databases.
Initial service‑oriented design using Hessian for RPC.
Physical DB isolation and master‑slave replication.
MQ for asynchronous messaging and task handling.
SLB‑based Nginx load balancing to eliminate single‑point failures.
Explosion Phase – Microservice Architecture V3.0
From 2016 onward, rapid user growth and complex business scenarios prompted a shift to microservices. Dubbo was chosen as the high‑performance RPC framework, enabling independent service development, deployment, and scaling.
Service‑centric design with independent microservice components.
Loose coupling and independent deployment of services.
High availability and horizontal scalability.
Distributed configuration management (Disconf) and task scheduling (Elastic‑Job).
Full‑link tracing with Meituan’s Cat APM integrated into Dubbo.
Custom microservice authorization, monitoring, and management via Dubbo’s console.
Key supporting tools included a version release system for automated deployment, multi‑environment pipelines (dev, test, pre‑release, prod), and comprehensive monitoring dashboards.
Future – Architecture V4.0
Containerization with Docker for rapid elastic scaling.
Unified API gateway for authentication, traffic control, and security.
Multi‑IDC deployment to achieve cross‑region redundancy and low‑latency access.
Conclusion
The evolution demonstrates that architecture must follow business growth: monolithic designs suit early rapid iteration, while distributed and microservice architectures provide scalability, resilience, and parallel development for mature platforms. Ongoing challenges include container orchestration, API governance, and multi‑region redundancy.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
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.
