How JD.com’s Shopping Cart Gained 30% Faster Performance with Full Asynchronous Refactoring
This article explains how JD.com’s retail shopping‑cart team tackled growing business complexity by redesigning the cart with a full asynchronous architecture, detailing the overall solution, implementation challenges such as fine‑grained retries and monitoring, and the resulting performance gains.
In the context of increasing business complexity, JD.com’s retail shopping‑cart team applied a full asynchronous refactor to boost system performance and user experience.
Background
The cart now supports many new services, deeper integration of front‑end calls, pre‑checkout features such as coupons and JD beans, and larger item capacity, leading to a rapid growth in RPC interfaces and pagination calls.
Full Asynchronous Refactor
The solution consists of three main parts:
Parallelizing different RPCs : Analyze dependencies, split code into asynchronous requests and result handling, and execute RPCs in parallel to reduce waiting time.
Batch interfaces with multi‑page parallelism : Wrap pagination logic in an async tool that automatically splits data exceeding interface limits into parallel pages, improving single‑interface response speed.
Underlying JSF async calls : Use JD’s RPC framework JSF (version 1.7.5+), which supports CompletableFuture.
Issues and Solutions
Fine‑grained retry : After async conversion, retries must be triggered on timeout during result processing, and only the failed page should be retried.
Complex async RPC monitoring : Record start time at pagination call and end time when async result arrives; separate metrics for normal and retry calls, and also monitor Get‑wait time.
Preserving async results per page : Results must be returned unchanged to retain Provider information for timeout diagnostics.
Per‑page timeout control : Each page’s timeout is calculated as
RPC_TIMEOUT > (now - asyncStart) ? RPC_TIMEOUT - (now - asyncStart) : 0.
Page balancing : Evenly distribute data across pages to avoid skew and maximize performance.
Benefits
After refactoring, core cart interface latency dropped by about 30%, improving user experience while saving substantial server resources. New RPCs on non‑critical paths have minimal impact, and capacity growth now has little performance penalty.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JD Cloud Developers
JD Cloud Developers (Developer of JD Technology) is a JD Technology Group platform offering technical sharing and communication for AI, cloud computing, IoT and related developers. It publishes JD product technical information, industry content, and tech event news. Embrace technology and partner with developers to envision the future.
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.
