A retail brand was drowning in its own success. Orders flowed in from multiple channels—web, marketplace, wholesale—each with different data formats, fulfillment rules, and return policies. Their existing system tried to unify everything into a single order table, but the complexity of multi-phase fulfillment (partial shipments, backorders, returns, exchanges) made the unified model brittle and error-prone.
The problem with the unified table. A single orders table works when fulfillment is simple: order in, shipment out. But modern retail fulfillment is multi-stage. An order might be split across warehouses, partially shipped, partially returned, and partially exchanged. Each stage generates its own data—tracking numbers, inventory adjustments, refund authorizations. Jamming all of this into one table creates a schema that is either too rigid to accommodate variation or too loose to enforce consistency.
The exchange pattern. We designed a decoupled architecture that treats the order system and the fulfillment system as separate domains connected by an exchange—a message broker that translates between order events and fulfillment actions. When an order is placed, the exchange publishes an event. The fulfillment system consumes it, generates pick lists, allocates inventory, and publishes back shipment confirmations. The order system receives these confirmations and updates its state.
This separation means that adding a new fulfillment channel—say, a marketplace integration—requires changes only on the fulfillment side. The order system remains unchanged. Returns, exchanges, and corrections flow through the same exchange, each as a distinct event type with its own processing logic.
Traceability. For clients operating under EU consumer protection regulations or fulfilling government procurement contracts, traceability is non-negotiable. The exchange pattern provides a complete audit trail: every state transition is recorded as an immutable event. This satisfies both regulatory requirements and operational debugging needs.
In public-sector contexts, where procurement tenders on TED or contracts on SAM.gov often mandate full order traceability, this architecture provides the compliance guarantees without sacrificing operational flexibility.

