Designing Scalable Backend Architecture and Push Systems: Boundaries, Organization, and Feedback
The article by Tencent backend expert Lv Yuanfang explains how to design scalable mobile‑internet backend architectures and push services by defining clear protocol boundaries, aligning system components with team organization through a conversion‑layer service, and implementing comprehensive feedback loops—including health metrics, monitoring, and data‑driven analysis—to ensure high availability and low coupling.
This article, authored by Tencent backend technology expert Lv Yuanfang, discusses the principles and practical details of designing large‑scale backend architectures for mobile internet services.
Background : As mobile internet matures, massive services become the norm. High availability is the core goal, and developers must consider architecture boundaries, organizational attributes, and feedback mechanisms to build robust systems.
1. Architecture Boundaries : The author lists key considerations such as boundary thinking, responsibility separation, contract spirit, high cohesion, low coupling, and clear layering. An example of an app‑to‑backend HTTP interaction is given, showing how to define protocol layout, request/response fields, and error codes.
Protocol Definition (JCE) :
struct ReqHead {
Int cmdId;
...
}
struct Request {
ReqHead head;
vector
body;
}
struct PkgReq {
PkgReqHead head;
Request request;
}The HTTP body consists of three parts: YYB (magic bytes), version number, and the PkgReq structure. The version field distinguishes protocol versions.
Example command structures:
Struct Cmd1Request {
}
Struct Cmd1Response {
Int ret;
}All JCE definitions reside in a single Protocol.jce file, which includes layout, common headers, command request/response structs, and error code enums.
2. Organization Attributes : System architecture should align with team organization. When architectural and organizational boundaries coincide, strict interface contracts, monitoring, and clear responsibilities become essential. The article describes the challenges of using L5 (Tencent's internal name service) directly and proposes a conversion layer service PDUBridgeServer to simplify calls, centralize monitoring, and reduce deployment complexity.
Conversion Layer Service :
interface PushAPI {
// single device push
int pushSingleDevice(PushSingleDeviceReq req, out PushSingleDeviceRsp rsp);
// multi‑device push
int pushMultiDevice(PushMultiDeviceReq req, out PushMultiDeviceRsp rsp);
// push to all online devices
int pushAllOnlineDevice(PushAllOnlineDeviceReq req, out PushAllOnlineDeviceRsp rsp);
// push to all devices
int pushAllDevice(PushAllDeviceReq req, out PushAllDeviceRsp rsp);
}The service provides a unified TAF interface, reduces the need for per‑machine L5 agents, and adds monitoring and alerting for each mod/cmd call.
3. Architecture Feedback : Feedback includes health metrics, performance data, call chains, business statistics, and trend analysis. Simple monitoring is insufficient; a systematic feedback loop helps evolve the architecture. The author shares real cases such as monitoring high exception rates on L5 calls, integrating ElasticSearch for search services, and handling traffic spikes caused by keyword‑spamming.
Examples of monitoring dashboards and A/B testing graphs illustrate how data-driven feedback guides architectural improvements.
Conclusion : Effective backend architecture requires clear boundaries, high cohesion/low coupling, organized interfaces, and comprehensive feedback mechanisms. The article invites readers to share their own experiences and offers additional resources for deeper learning.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
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.