The overall architecture
Where does the local transaction end before external fulfilment?
The data contract leads to this topology: customer portal → order API → relational order, stock and credit-reservation datastore. The fulfilment worker reads the outbox → inventory management. Response intake stores inbox records → reconciliation worker converts reservations to receivables. The sales interface maintains versioned offers through the same API. Internal modules are domain code boundaries; a separate process has its own operational lifecycle.
Starting point Perform both checks and reservations in one transaction.
Assumptions for the example case
A fictional example design with one customer, one currency and one warehouse; a binding price offer; complete local stock and credit reservations; and one complete delivery. Figures and quality goals are illustrative test assumptions. Multiple currencies, tax calculation, partial delivery and credit insurance are outside the scope.
Runtime architecture
Runtime architecture · Local reservations, asynchronous fulfilment
Wholesale platform
The API commits the order, both reservations and outbox; inbox and reconciliation bring external delivery evidence back into the system.
Domain modules within the application
Inside the order API · Five domain modules
The modules coordinate a local commit and share the authoritative relational datastore.
Operational boundaries
- Runtime
- Customer portal → order API → relational order, stock and credit-reservation datastore. The fulfilment worker reads the outbox → inventory management. Response intake stores inbox records → reconciliation worker converts reservations to receivables. The sales interface maintains versioned offers through the same API.
- Persistence
- Transactional datastore for order A-101, offer P-101 and stock W-101. Authoritative changes and retry results are stored together; external effects require their own evidence.
Process fulfilment after the commitment
Persist the local commitment and transmit the external order separately.
Inventory management responds slowly.
Network waiting time does not hold a stock lock.
- Alternative considered
- An external call inside the transaction prolongs locks.
- Trade-off
- Fulfilment status initially remains open.
- Reassess
- Inventory management offers a shared atomic interface.
Terms in this step
- Process fulfilment after the commitment
- Network waiting time does not hold a stock lock.
Try it yourself
Inventory management responds only after ten seconds. Where does the network call run, and which state is already durable?
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- The local commitment and fulfilment request are first stored durably together.
- Second part of the solution
- The worker calls the external system. During those ten seconds, no local inventory lock is held for the network call.
Apply to your project
Which corresponding assumption would you test first in your project? Consider this trigger: Inventory management offers a shared atomic interface.