Backend Development 15 min read

Mogujie E‑Commerce Transaction Platform Architecture and Service Refactoring

The article details how Mogujie's e‑commerce transaction system evolved from a monolithic PHP application to a service‑oriented architecture through DB vertical sharding, service decomposition, custom sharding component TSharding, and performance optimizations such as asynchronous processing, caching, and distributed transaction handling to support rapid growth and high‑availability requirements.

High Availability Architecture
High Availability Architecture
High Availability Architecture
Mogujie E‑Commerce Transaction Platform Architecture and Service Refactoring

Pan Fujian, a senior R&D engineer at Mogujie, shares the evolution of the company's transaction platform from its early guide‑shopping phase, built on a simple PHP monolith, to a large‑scale social e‑commerce system facing explosive growth.

The rapid increase in traffic (over 3× yearly growth, peak orders reaching hundreds per second) exposed problems such as limited system capacity, tight coupling, and difficulty extending functionality.

To address these issues, the team embarked on a systematic service splitting process, starting with vertical DB sharding, followed by separating core services (shopping cart, order, payment, etc.) and establishing clear service interfaces and governance.

Key technical steps included:

Vertical DB sharding with read/write separation and partitioning to increase write throughput.

Development of a lightweight custom sharding component TSharding (based on MyBatis plugin) supporting data source routing, transactions, result merging, and read/write separation.

Performance optimizations:

Additional measures for service level assurance included comprehensive monitoring, dependency governance, load balancing, rate limiting, degradation plans, disaster recovery, and capacity testing.

The refactoring resulted in a nascent SOA architecture with foundational service frameworks, messaging middleware, data middleware, configuration center, and supporting tools such as monitoring, scheduling, log collection, and tracing systems.

Future work focuses on service governance, SLA automation, and active‑active (same‑city and cross‑region) deployment.

The article concludes with a Q&A session covering message acknowledgment, distributed transaction strategies, smooth database migration, handling of old vs. new databases during rollout, and approaches to avoid cross‑shard joins.

Backende-commerceperformance optimizationShardingservice architectureDistributed Transactions
High Availability Architecture
Written by

High Availability Architecture

Official account for High Availability Architecture.

0 followers
Reader feedback

How this landed with the community

login 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.