Design and Implementation of the ETX Distributed Consistency Framework Based on CAP and BASE Principles
This article explains how 58 Recruitment’s ETX framework applies CAP and BASE theories, along with log‑first and TCC patterns, to achieve distributed eventual consistency and high availability for large‑scale transaction processing in backend systems.
58 Recruitment’s job platform serves millions of users and relies on a self‑developed distributed consistency framework (ETX) to ensure final consistency of its commercial services.
CAP Principle : In a distributed system, Consistency, Availability, and Partition tolerance cannot be simultaneously guaranteed; the article describes each component and why CA or CP alone cannot satisfy high‑concurrency internet services.
BASE Theory : Introduced as an alternative, BASE (Basically Available, Soft state, Eventually consistent) balances availability and consistency, making it suitable for internet‑scale applications.
Log‑First and TCC : The log‑first approach records critical information before invoking external services to handle failures, while TCC (Try‑Confirm‑Cancel) structures atomic business logic into three phases to ensure reliable rollback.
ETX Framework : ETX (Easy Transaction Framework) implements BASE principles, allowing developers to focus on business logic by defining Try, Confirm, and Cancel methods. The framework orchestrates these units using log‑first ordering, achieving all‑or‑nothing transaction outcomes.
The framework is abstracted into three layers: the protocol layer (interfaces for components, serialization, storage), the implementation layer (core transaction orchestration, state management), and the integration layer (concrete serialization, storage, monitoring implementations). It supports remote log, local log, and pure‑memory modes, with automatic failover for high availability.
Performance evaluations show that ETX adds less than 15% latency, handling up to 2 million transactions per day with nine‑nines (99.9999%) availability and consistency, reducing daily failure cases from dozens to zero.
References and author information are provided at the end of the article.
58 Tech
Official tech channel of 58, a platform for tech innovation, sharing, and communication.
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.