Redesign and Optimization of the WeChat Pay Transaction Record System
This article presents a comprehensive case study of how WeChat Pay rebuilt its transaction record storage to handle massive data growth, improve performance, ensure data completeness, and strengthen security through a distributed key‑value architecture, hierarchical archiving, and robust operational safeguards.
Background: Since the launch of WeChat Red Packet in 2013, the rapid growth of social payments caused the original transaction record storage, based on a single key/value per user, to hit size limits and performance bottlenecks.
Problems of the old system included oversized value objects, coupling of record writes to the payment critical path, incomplete record types, and inefficient query mechanisms.
Technical solution: Replace the monolithic key/value store with a distributed KV platform (tssd) that partitions user data into multiple values organized in a hierarchical, time‑based archive. Root nodes store metadata; data nodes hold actual records, enabling fast page‑wise access and O(log n) lookup for older entries.
Features such as classification, statistics, and flexible querying are implemented by scanning time‑range slices, with caching for monthly aggregates. Historical data migration required six months to cleanse and import 72.3 billion records from multiple sources.
Reliability improvements include full write‑ahead logging, a full‑link queuing mechanism to avoid data loss during storage timeouts, and strict access control, data masking/encryption, and personnel governance to protect sensitive transaction data.
Peak‑traffic handling uses request throttling and local disk buffering during holiday spikes, reducing the need for over‑provisioned resources.
Results: Complaint rate dropped 67 %, daily transaction records now reach tens of billions (over a trillion total), and user experience for record queries has greatly improved while meeting security standards.
Tencent Architect
We share insights on storage, computing, networking and explore leading industry technologies together.
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.