How WeChat Reading Scaled Its Backend Architecture Over 10 Years

This article chronicles the decade‑long evolution of WeChat Reading’s backend, detailing architectural layers, RPC framework innovations, storage migrations, account system redesign, book data platform construction, and modern content retrieval techniques that together enable high availability and scalability.

Architect
Architect
Architect
How WeChat Reading Scaled Its Backend Architecture Over 10 Years

Introduction

2023 marks the 10th anniversary of WeChat Reading, and its backend architecture has undergone multiple iterations and upgrades. Each component upgrade and architectural breakthrough on a ten‑year‑old system required decisive action and close collaboration with business.

Overall Architecture

WeChat Reading is an independent app with distinct development and operation environments, resulting in a complete backend architecture from access layer to storage layer.

Architecture diagram
Architecture diagram

The architecture is divided into typical access, logic, and storage layers:

Access layer: multiple CGI services isolated by business, providing routing, rate limiting, caching, long connections, etc.

Logic layer: WRMesh framework builds micro‑services, offering RPC, service discovery, overload protection, rate limiting, monitoring, etc.

Storage layer: PaxosStore stores user data with high availability and strong consistency, using K‑V and K‑Table types; BookStore handles book storage, and Tencent Cloud PaaS storage is also used.

RPC Framework

The micro‑services originated from the Hikit framework written in C++. As WeChat Reading grew, a GO‑based recommendation system was deployed on TKE, creating heterogenous services. To achieve unified service governance, the WRMesh framework with a Sidecar + Business model was developed.

WRMesh architecture
WRMesh architecture

Sidecar handles network logic, while Business contains business code. Sidecar integrates Hikit’s service‑governance core, communicates via UnixSocket, and can be used by services written in any language.

Migration to the WXG P6N container platform faces challenges such as framework adaptation, service inter‑call compatibility, and storage migration.

We adopted a compromise: retain the existing enterprise‑WeChat operation environment while building proxy layers (Svrkit, WQueue) to interconnect with P6N services.

Book Data Platform

Books are the core content of WeChat Reading. Initially we relied on the Yuewen Group API for e‑book resources. Recently we shifted to a book‑data middle platform, exposing management APIs for operations to handle book creation, modification, publishing, and licensing.

The book lifecycle includes formatting, pre‑publishing, EPUB parsing, chapter splitting, and storage in the StoreSvr service, which provides high‑availability book information and download APIs.

We also built a repair service to fix UGC offset errors after book replacement, using Chubby for task coordination and custom KV/KT‑Table middleware for batch writes.

Book data platform
Book data platform

Account System Availability

The account system provides login, session key generation, and user profile management. Historically it ran AccountSvr and MySQL on the same machine with master‑slave replication, leading to reliability issues.

In 2024 we migrated to Paxosmemkv, an in‑memory, multi‑replica, strongly consistent storage, and redesigned the account service to eliminate segment‑based allocation and caching.

Content Retrieval Evolution

Search originally relied on text‑based retrieval using in‑memory indexes and Elasticsearch for full‑text search. With the rise of large language models, we built a RAG (retrieval‑augmented generation) system to support semantic search over millions of book paragraphs and user‑generated content.

Data is split into globally searchable and user‑private searchable sets. Global data uses chunking, embedding, and a combination of fkv and Elasticsearch with DiskANN. User data uses per‑user indexes stored on COS and loaded on demand via USearch/Xapian.

RAG retrieval architecture
RAG retrieval architecture

Conclusion

Over ten years, WeChat Reading’s backend has continuously evolved, focusing on scalability, reliability, and openness, preparing for the next decade of growth.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

backend architecturemicroservicesservice governancewechat readingbook data platformcontent retrieval
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

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.