Business Gateway Architecture and Flow Orchestration in JD Daojia
This article explains the role, challenges, and solution of JD Daojia's business gateway, detailing how it aggregates multiple backend services, adopts workflow orchestration to improve code consistency, scalability, and development efficiency, and outlines future architectural considerations.
JD Daojia, a leading local instant retail platform under the Dada Group, delivers a wide range of products to consumers within about one hour. The business gateway acts as the traffic entry point for specific business pages such as the home page, channel page, activity page, store page, and product page, aggregating data from various backend services before presenting it to the app.
The gateway sits after the API gateway and before core services in the architecture. It collects data from product, pricing, promotion, store, inventory, CMS, coupon, recommendation, and other services, applying business rules to merge and format this data for the client.
Using the home page feeds flow as an example, the gateway must gather elements like product info, price, promotions, store details, shipping, coupons, banners, flash sales, and ranking images, each originating from different services, and also incorporate location‑based store lists obtained from the LBS system.
Key challenges identified include inconsistent coding styles across developers, system bloat due to scattered compatibility logic, duplicated effort when adding new features, and sub‑optimal aggregation efficiency caused by high call volumes, improper thread‑pool usage, and non‑parallelized service calls.
To address these issues, the aggregation work is transformed into a business model and solved with workflow orchestration. Two orchestration patterns are discussed: the Pipeline mode, which sequences tasks in a linear pipeline but may hinder optimal execution time, and the Arbitrary Combination mode, which preserves task independence while allowing flexible dependency‑based execution.
JD Daojia adopts the Arbitrary Combination mode in its service orchestration tool, which consists of execution units, a flow controller, and a data pool. Execution results are stored in ThreadLocal or a ConcurrentHashMap‑based data pool, enabling downstream tasks to retrieve prior results without tight coupling.
Benefits of this approach include unified development conventions, encapsulated business functions, reusable service components, a holistic view of the entire business flow, and significantly shortened development cycles by reusing existing capabilities and only adding minimal new code for new pages.
In conclusion, as business requirements continue to evolve, maintaining a flexible and well‑designed architecture is essential to avoid maintenance difficulties and hidden risks, and ongoing adoption of industry‑leading solutions will drive continuous improvement.
Dada Group Technology
Sharing insights and experiences from Dada Group's R&D department on product refinement and technology advancement, connecting with fellow geeks to exchange ideas and grow together.
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.