Backend Development 8 min read

Rapid Construction of the 7Fresh Retail System Using Domain‑Driven Design

The article details how JD.com’s 7Fresh retail platform was built in just two and a half months by applying strategic DDD, virtual organization structures, extensive component reuse, and cross‑team collaboration to integrate over 60 systems and dozens of devices for both online and offline operations.

JD Tech
JD Tech
JD Tech
Rapid Construction of the 7Fresh Retail System Using Domain‑Driven Design

7Fresh is JD.com’s first online‑offline integrated retail innovation, featuring more than 60 systems—including POS, production, processing, shelf display, smart mirror, catering, and self‑checkout—connected to dozens of devices such as electronic price tags, scales, packaging machines, autonomous carts, and foot‑traffic detectors.

The first phase launched over 40 systems, followed by an additional 20, achieving a development speed that many considered impossible.

JD Technology Salon, organized by the Enterprise Informatization Department and JD University, presents a review of the rapid 0‑to‑1 construction of the 7Fresh system.

System Construction Timeline

Similar to JD Mall, 7Fresh has a complete transaction and one‑click settlement system, but also includes many offline subsystems for production, processing, inventory, and catering. The entire project—from product research and architecture design to the first‑phase launch—was completed in 2.5 months, with 40+ systems going live simultaneously, and continuous addition of new catering and field‑promotion features.

Key Factors for Rapid Development

Strategic design using Domain‑Driven Design (DDD) to split concerns, define bounded contexts with a ubiquitous language, and isolate business changes with a thin integration layer.

Establishment of a virtual architect organization early on, later expanded to include product members, continuously refining methodology and principles.

Other contributors: multi‑team collaboration across Chengdu, Wuhan, and technology expansion groups; accumulated frameworks and components such as pop‑spring‑boot, popdesign, and scaffolding; heavy involvement of business teams to align development with business needs.

Our Understanding of DDD

Strategic aspects include:

Dividing and integrating bounded contexts, emphasizing a shared language within each context to avoid over‑extending concepts beyond their domain.

Focusing on service‑oriented integration rather than data‑oriented integration, allowing downstream systems to abstract requirements and define their own standards.

Using technology‑agnostic domain models—class diagrams, state charts, and object snapshots—to describe the domain.

Tactical implementation faces challenges:

Code as design: expressing design intent in code is difficult for performance‑related attributes, while domain design is more naturally reflected.

Identifying aggregate roots and avoiding the “anemic” model; the existing framework tends toward mechanical coding that hinders the desired outcomes.

High cost of database transactions across aggregate roots, making them impractical.

Representing entities via packages to separate domain objects, services, and repositories, applying dependency inversion to keep infrastructure separate.

Complex order‑state transitions across various business scenarios, currently handled with extensive conditional logic in service layers.

Data consistency: using database transactions within a microservice for internal consistency, while employing MQ‑based domain events for eventual consistency across bounded contexts.

Overall, the 7Fresh case demonstrates that strategic DDD, a virtual architect team, reusable frameworks, and strong business‑tech collaboration can dramatically accelerate the delivery of large‑scale, multi‑system retail solutions.

backendsystem architecturemicroservicesdomain driven designDDDretail
JD Tech
Written by

JD Tech

Official JD technology sharing platform. All the cutting‑edge JD tech, innovative insights, and open‑source solutions you’re looking for, all in one place.

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.