How Zhongtong Scaled to Billions‑Level Billing with the Pangu Distributed Backend

This article details how Zhongtong's finance‑information department built the Pangu system—a distributed, micro‑service‑based backend leveraging sharding, Elasticsearch, Kafka‑like messaging, and Hadoop—to handle over a billion daily scan records, achieve real‑time billing, and support multi‑year growth.

Zhongtong Tech
Zhongtong Tech
Zhongtong Tech
How Zhongtong Scaled to Billions‑Level Billing with the Pangu Distributed Backend

Project Background

With e‑commerce platforms and company operations expanding rapidly, Zhongtong processes over 26 million parcels daily, generating more than 1 billion scan records and nearly a hundred million data entries each day. Traditional technology could no longer meet the explosive growth, leading to performance bottlenecks in scanning preprocessing, billing, data query, and horizontal scalability.

Project Outcome

The Pangu platform, built as an internet‑technology pilot, establishes a distributed infrastructure centered on distributed databases, micro‑services, messaging, and search. It now handles near‑billion‑level daily data preprocessing and tens of millions of billing records, supporting core fees such as transit, scale‑weight, and receipt fees.

Key Architectural Features

Elastic Scaling : Distributed deployment enables horizontal scaling; the scan‑message processing (TBS) reaches 5,000 TPS (peak 12,000 TPS) during major events.

Sharding Strategy : Database sharding and table partitioning allow seamless addition of servers; hash‑based routing determines instance and table placement.

Event‑Driven Model : Unified billing events, details, and invoices are modeled for future settlement extensions.

Configuration Management : Key‑value stores simplify complex configuration maintenance.

Service Isolation : Independent services reduce data redundancy, inconsistency risk, and inter‑service impact.

Asynchronous Task Scheduling : Reduces server load during peak periods and prevents duplicate task execution.

Unified Gateway : Facilitates cross‑language service interaction.

Implementation Overview

1. Client

The front‑end is built with HTML5, separated from the back‑end via RESTful APIs, and accelerated with CDN. Authentication and authorization integrate with an internally developed metadata management system for stateless login.

2. Load Balancing

NGINX clusters perform reverse proxying with weighted average algorithms for load distribution.

3. Web Layer

Data service platform standardizes API style and exposure.

Spring Boot powers rapid development of the web application framework.

Dubbo (with Zookeeper) provides RPC; internal calls use Dubbo, external calls are exposed as RESTful APIs via a gateway.

WebSocket enables real‑time message push.

4. Data Storage

Database : MySQL with 16 instances (8 master + 8 slave), 1,024 tables, each instance hosting 128 tables. Sharding‑JDBC handles sharding; hash of the waybill number determines instance and table.

Cache : Redis for high‑speed caching and atomic queues.

Data Sync : Alibaba Canal syncs MySQL changes to message queues.

Message Queue : RocketMQ decouples systems and smooths traffic spikes.

Search : Elasticsearch supports multi‑dimensional queries on tens of millions of records with millisecond response times.

Coordination : Zookeeper coordinates TBSchedule, Dubbo, etc.

Big Data Processing : Hadoop ecosystem generates large‑scale reports and analyses; HDFS serves as the file export server, offering high compression and multi‑level indexing.

5. Service Governance

CAT monitors service links for quick issue localization.

ELK stack records system logs for querying and tracing.

In‑house Lighthouse monitoring provides proactive alerts.

Custom DevOps platform addresses service quality, deployment, operations, and implementation.

Results

All types of Zhongtong transit fees are now processed through Pangu, achieving daily reconciliation for 29,000 outlets, exporting 50 million records, billing at the hundred‑million level, and supporting multi‑dimensional queries on 6 billion records. The system’s scalability roadmap projects capacity for the next 3‑5 years of growth.

Scalability roadmap
Scalability roadmap
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 architecturescalable billing
Zhongtong Tech
Written by

Zhongtong Tech

Integrating industry and information for digital efficiency, advancing Zhongtong Express's high-quality development through digitalization. This is the public channel of Zhongtong's tech team, delivering internal tech insights, product news, job openings, and event updates. Stay tuned!

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.