Overall architecture
Which boundaries support operation, and which make domain responsibilities understandable?
The data model requires joint local decisions and a separate approach to external effects. We start with an order API and a background process from the same application. Domain modules structure the code. They are not individually operated services here. The background process reads permanently earmarked work and compares open payments.
Starting point The atomic replacement change from step 5 determines which data must be reachable together.
Assumptions for the example case
Own example design for pick-up from a store and packaged piece goods with strictly positive integer cent prices. Free and fully discounted baskets are outside the case. Replacement items are specifically allowed in advance; the final positive amount arises from goods actually provided and is collected on collection. Figures and target values are illustrative design assumptions.
Runtime components and external boundaries
Seven nodes · twelve directed relationships · one backend boundary
Back end limit · Order application
- 01Customer interface → Order APIOrder/Read status
- 02Order API → Customer interfaceBasket and status
- 03Store interface → Order APIPick / restock / hand over
- 04Order API → Store interfaceResult / Conflict / Release
- 05Order API → Transactional storeAtomic Commands / Inbox
- 06Transactional store → Order APICommit / authoritative state
- 07Background process → Transactional storeRead Outbox, Feed and Save Results
- 08Transactional store → Background processOpen instructions / sequence watermark
- 09Inventory management → Background processOrderly branch movements
- 10Background process → Payment serviceExecute E-17 / Reconcile status
- 11Payment service → Background processResponse / confirmed status
- 12Payment service → Order APISigned feedback
Order API and background process belong to the same application. Local decisions share the transactional store; external effects remain orders in need of confirmation.
Open the order API technically
Inside the order API · five domain modules in one process
Process framework · Order API
- 01Order → Substitution checkChecking item/quantity/price
- 02Order → Store availabilityAllocate / record pick
- 03Order → Payment and handoverTransfer frozen basket
- 04Payment and handover → Cases requiring reviewReport unresolved charge
The modules organise domain responsibilities. They collaborate through local calls and require no network service.
Case decision and verification approach
Start with a modular monolith, separately running background processing and shared storage.
The replacement pick must change the order status and two item statuses together.
The local transaction remains manageable. A process restart after commit must not lose the outbox order.
- Alternative considered
- Separate inventory and ordering services require an additional distributed commitment contract.
- Trade-off
- Schema changes and releases remain coordinated.
- Reassess
- Independent teams, significantly different loads or evidenced availability requirements justify a new service limit.
Terms in this step
- Modular monolith
- A jointly operated application with technically separate modules and local atomic changes.
- Background process
- A dedicated runtime process for permanently earmarked transmission, feed import, payment reconciliation and clarifying lists.
Try it yourself
Assign substitution checking, the background process and the payment service to module, runtime process and external system. Justify shared storage for the substitute pick.
A hint for your attempt
A technical task does not automatically need its own network connection.
Compare with a possible solution
- Domain module
- The replacement check is a module within the order API.
- Runtime process
- The background process runs independently and continues permanent work.
- External border and storage
- The payment service is an external system. The shared local data storage allows both item stands and the pick to be changed atomically; the external payment remains an order in need of confirmation.
Apply to your project
Which boundary solves a specific operational problem in your system?