Ant Financial’s Distributed Transaction Evolution and the Open‑Source Seata Framework
This article explains how Ant Financial tackled cross‑service and cross‑database data‑consistency challenges caused by horizontal sharding and service‑oriented decomposition, introduces its home‑grown distributed‑transaction middleware and the open‑source Seata project with AT, TCC, Saga and XA modes, and shares performance‑optimisation and high‑availability practices.
Ant Financial’s rapid growth led to horizontal database sharding and service‑oriented decomposition, which introduced cross‑database and cross‑service transaction problems, especially in financial scenarios such as money transfer where atomicity is critical.
The company first built its own distributed‑transaction middleware (DTX) to guarantee data consistency across multiple services and databases, evolving it over more than a decade.
In 2019 Ant Financial and Alibaba open‑sourced the solution as Seata (Simple Extensible Autonomous Transaction Architecture), providing four transaction models: AT (non‑intrusive, snapshot‑based), TCC (Try‑Confirm‑Cancel with explicit business logic), Saga (long‑running compensating transactions), and XA (standard two‑phase commit supported by XA‑compatible databases).
Seata’s architecture consists of three core modules: Transaction Manager (TM), Resource Manager (RM) and Transaction Coordinator (TC). The TM initiates a global transaction, the RM registers resource states, and the TC decides commit or rollback in the second phase.
Performance‑optimisation techniques include the “same‑database” mode, which writes transaction logs directly to the database, reducing TCP hops, and asynchronous execution of the second phase, cutting the perceived latency of two‑phase commits by roughly 50%.
For high availability, Seata services are deployed in Ant Financial’s three‑site five‑center architecture, making the services stateless and synchronising database replicas across data centers to achieve 99.99% availability.
The article concludes that Ant Financial’s 12‑year experience with distributed transactions, now embodied in Seata, offers a comprehensive set of solutions for various consistency requirements in modern micro‑service architectures.
AntTech
Technology is the core driver of Ant's future creation.
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.