Backend Development 14 min read

AREX: Ctrip’s Open‑Source Traffic Recording and Replay Platform – Architecture, Challenges, and Best Practices

The article introduces AREX, Ctrip’s open‑source traffic recording and replay platform, detailing its background, design decisions, technical challenges such as cross‑thread collection and non‑idempotent interfaces, deployment strategies, best‑practice integration with CI/CD pipelines, and the measurable benefits achieved across thousands of applications.

Ctrip Technology
Ctrip Technology
Ctrip Technology
AREX: Ctrip’s Open‑Source Traffic Recording and Replay Platform – Architecture, Challenges, and Best Practices

Author: Ctrip AREX team, ticket quality engineering group, focusing on automated testing tools to improve quality and efficiency.

AREX is an open‑source traffic replay platform originated within Ctrip’s ticket BU, built to record and replay core request flows. After extensive iteration in complex business scenarios, it now serves over 4,000 applications, improving delivery rates and reducing defect counts.

Background – Traffic recording and replay are valuable for performance testing, regression testing, automated testing, and rapid online issue resolution, but face challenges like heavy infrastructure setup, disproportionate upfront costs, and unclear deployment scenarios.

Solution – Existing open‑source tools based on JVM‑Sandbox‑Repeater lack support for many middleware and frameworks used at Ctrip, and miss comprehensive backend services for data collection, storage, and comparison. AREX was therefore developed to support a broader range of components, provide a full‑stack solution with UI, replay services, and reporting, and enable one‑stop workflows.

Technical Challenges

3.1 Cross‑thread and asynchronous traffic collection – AREX uses a Trace‑based approach, passing a recordId across threads (e.g., CompletableFuture, ThreadPoolExecutor, Reactor, RxJava) to capture all operations.

3.2 Non‑idempotent interface replay – Mocking is applied to frameworks like Spring, Dubbo, Redis, Mybatis to avoid dirty data during replay.

3.3 Authentication and token expiration – AREX can mock security frameworks (Spring Security, Apache Shiro, JWT) to bypass auth checks during replay.

3.4 Time‑sensitive scenarios – Current time is recorded during capture and mocked during replay to keep timeout logic consistent.

3.5 Local cache handling – Support for popular caches (Guava, Caffeine) and extensible plugins for custom caches ensures cache behavior is reproduced.

Deployment Challenges

4.1 Simple, rapid installation – AREX offers one‑click, non‑container, and private‑cloud deployment modes, as well as a standalone mode for quick local trials.

4.2 Data security – Sensitive data is desensitized via SPI‑loaded external JARs during storage.

4.3 User experience – Test case aggregation, noise reduction (timestamps, UUIDs, IPs), and local debugging accelerate issue localization.

4.4 Maturity and reliability – Built on Java Agent and ByteBuddy, AREX runs stably in Ctrip for over two years, with adaptive sampling under high load.

Best Practices

Integration into CI/CD pipelines: select the AREX Agent in the pipeline, load the agent via -javaagent:/arex-agent.jar, and use version‑matched jars for gray releases.

Automated replay triggers after code commits, with results (pass rate, failure rate) fed back to gate releases.

Continuous feedback loops enable developers to focus on new features while AREX handles automated testing and quality assurance.

Results

Over 4,000 applications have adopted AREX, achieving higher delivery rates and fewer defects.

Open‑Source Commitment

In 2023 AREX was open‑sourced on GitHub (https://github.com/arextest) to help other enterprises adopt low‑cost traffic replay solutions; thousands of external users have already joined.

The platform aims to maintain quality while supporting rapid iteration, and invites developers to contribute to the community.

CI/CDmicroservicesAutomated Testingtraffic replayperformance testingJava agent
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

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.