Databases 16 min read

Distributed Transaction and Data Consistency Solutions for E‑commerce Systems

The article examines the challenges of maintaining data consistency across distributed services in e‑commerce, explains strong, weak and eventual consistency models, and presents six practical solutions—including business integration, the eBay BASE pattern, Qunar, Mogujie, Alipay DTS, and Nongxin—highlighting how local transactions, idempotent messaging, and eventual consistency can replace heavyweight distributed‑transaction frameworks.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
Distributed Transaction and Data Consistency Solutions for E‑commerce Systems

In large‑scale e‑commerce systems, multiple independent services must cooperate while preserving data consistency, prompting a discussion of strong, weak, and eventual consistency models and their trade‑offs under the CAP theorem.

Strong consistency guarantees that every read sees the latest write but requires sacrificing availability; weak consistency offers no such guarantee; eventual consistency ensures that, absent further updates, all replicas will converge to the same value.

To achieve high availability without full strong consistency, the article outlines six practical approaches:

1. Business integration (avoid distributed transactions) – consolidate remote services A, B, C into a single local service D, converting the problem to a local transaction, though at the cost of tighter coupling and reduced modularity.

2. Classic eBay (BASE) pattern – use asynchronous message logs with idempotent processing, record applied updates in an updates_applied table, and rely on retries to achieve eventual consistency; this mirrors the BASE principle (Basically Available, Soft state, Eventually consistent).

3. Qunar’s distributed‑transaction solution – split a monolith into micro‑services, then transform distributed transactions into a series of local transactions coordinated via asynchronous messaging and compensating actions, handling failures through retries or rollbacks.

4. Mogujie transaction creation – create an invisible order first, then invoke coupon‑locking and inventory‑deduction services; on failure, send a cancellation message to MQ with retry logic, ensuring eventual consistency while keeping the critical path fast.

5. Alipay/DTS (Distributed Transaction Service) – a Java‑based framework that implements a BASE‑inspired two‑phase‑commit‑like protocol, providing eventual consistency across heterogeneous services (MySQL, Oracle, KV stores, HBase) without tying the system to a specific RPC or transaction engine.

6. Nongxin data‑consistency scheme – combine synchronous calls for low‑impact operations (e.g., points addition) with asynchronous MQ notifications for high‑impact actions, using idempotent consumers and retry mechanisms to maintain consistency.

All solutions share the core idea of breaking a global transaction into multiple local transactions and using reliable messaging, idempotency, and retry/compensation to achieve eventual consistency without the complexity of heavyweight two‑phase commit systems.

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.

MicroservicesData ConsistencyBASEDistributed Transactionseventual consistencyidempotent messaging
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

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.