Supply Chain Business Model, Architecture, and Complexity Solutions in Retail SaaS
The article outlines Youzan’s SaaS supply‑chain solution for retailers, detailing its end‑to‑end business model, layered architecture, and complexity‑reduction tactics such as domain‑driven design, event‑driven orchestration and strategy‑based abstraction, while explaining how supply‑chain inventory is transformed into sales inventory and noting future plans for a visual workflow engine.
1. Background
In the operation of a physical retailer, the supply chain is an unavoidable topic. A good supply chain can improve operational efficiency and reduce costs. As a SaaS service provider, Youzan receives many supply‑chain management requests from merchants and aims to provide supply‑chain functionality as part of its service offering.
2. Supply Chain Business Model
The supply‑chain business is process‑heavy and has a complex workflow. The diagram below shows the end‑to‑end process from demand initiation to fulfillment, with different branches based on merchant requirements.
3. Supply Chain Architecture
3.1 Supply Chain Business Architecture
Inventory Demand Planning : Data used for merchants to create and assist supply‑chain plans.
Inventory Demand : Handles multi‑party interactions such as purchase orders (supplier ↔ warehouse) and allocation/distribution (outbound ↔ inbound).
Warehouse Operations : Internal warehouse tasks that do not require external coordination.
Supply Chain Master Data : Manages basic master data such as warehouse info, supplier data, stock levels, and unique identifiers.
3.2 Relationship Between Supply‑Chain Applications
Access Layer : Presentation terminals.
Gateway Layer : Maps external and internal interfaces, performs basic authentication and permission checks.
Query/Search : CQRS‑based document search module.
Business Systems : Provide concrete business functions.
retail-stock:Currently hosts inventory master data and demand business functions. Future growth will split additional systems.
retail-stock-purchase:Handles inventory‑demand‑level business functions.
retail-stock-scm:Entry point for supply‑chain distribution to sales channels.Infrastructure Services : Provide underlying technical capabilities.
3.3 Supply‑Chain Application Architecture
Inventory System
Procurement & Allocation System
Presentation Layer : Entry point for data display and user operations.
Service Aggregation Layer : Orchestrates public services and assembles data for complete business operations.
Public Service Layer : Core business processes providing domain models and services.
Infrastructure Layer : Offers generic technical capabilities.
4. Solutions to Complexity
4.1 Divide and Conquer – Clarify Business Boundaries
Domain‑Driven Design (DDD) is used to split the complex supply‑chain domain into sub‑domains with clear boundaries, enabling reuse and easier composition across industries.
4.2 Process Orchestration – Handle Workflow Variations
Each business operation is atomized; after completion, an event message is emitted. The orchestration engine consumes these events and, based on merchant configuration, selects and executes the next step, keeping each operation pure and decoupled.
4.3 Internal Function Abstraction – Resolve Operation Differences
Internal variations of a business operation are abstracted using the Strategy pattern, allowing dynamic loading of step‑specific logic.
5. Relationship Between Supply and Sales Ends
5.1 Business Model
In traditional e‑commerce, sales inventory is set directly on the sales channel. In retail scenarios, sales inventory is derived from actual stock. Youzan’s supply‑chain converts supply‑chain inventory to sales inventory as shown below.
Warehouse Stock Layer : Physical, allocated, in‑transit, and planned stock.
Dispatch Stock Layer : Calculates sales inventory based on stock resources and supply relationships .
1. Stock Resource: Represents usable stock quantity from a warehouse, abstracting away detailed stock types.
2. Supply Relationship: Consists of a supplying warehouse (with storage capability) and a sales channel (with sales capability).Sales Stock Layer : Quantity available for each sales channel.
5.2 Order‑Driven Stock Deduction Process
Because a warehouse may serve multiple channels, direct deduction from sales stock can cause overselling. Therefore, order‑time stock deduction occurs at the dispatch‑stock level, triggering an update of the sales‑stock view.
Order deduction flow:
After a user places an order, the fulfillment system queries the dispatch layer for supply relationships and warehouse resources, selects an appropriate warehouse based on routing rules, and then deducts stock. Upon successful order creation, a fulfillment order is generated to trigger delivery tasks.
6. Conclusion and Reflection
This article introduced the complexity of supply‑chain business, the measures taken to address it, and the relationship between supply‑chain and sales inventory. Currently, supply‑chain orchestration relies on asynchronous event messages, which hampers readability and traceability. Future work includes integrating Youzan’s internal workflow engine to provide visualized process execution.
Youzan Coder
Official Youzan tech channel, delivering technical insights and occasional daily updates from the Youzan tech team.
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.