The overall architecture
How are responsibility for the collection route and external processing divided between modules and processes?
The local consistency rule determines the boundary of the collection route API. Device synchronisation runs separately to handle deferred work. Route assignment, bin-emptying records, mass reconciliation and record completion are modules within the API. Route planning uses this API and its relational assignment store. The vehicle keeps a local event journal during coverage gaps; device synchronisation accepts reports durably and deduplicates them. Separately, the receiving facility supplies weighing and handover records. Record completion joins the collection and receiving paths once the mass discrepancy and every bin outcome have been resolved. Route recommendations remain a read model and create no emptying records. The architecture thus has two converging chains of evidence.
Starting point Each route-and-bin work order records one effective emptying.
Assumptions for the example case
Original fictional example design. A municipal collection service for non-hazardous waste uses its own operational records and confirmed handovers. The illustrative load limit is 10000 kg; additional planned loading is allowed only if total mass remains ≤ 10000 kg. All figures and test targets are illustrative assumptions.
Runtime components and datastores
Runtime topology
Route and records system
Each emptying takes effect once per bin and route. Completion requires a handover record and resolved discrepancies.
Domain responsibilities within the API
Inner modules
Modules group responsibilities within the API process.
Map responsibilities to runtime components
| Domain task | Runtime | Responsibility |
|---|---|---|
| Route assignment | Collection route API | Links the bin, vehicle and collection work order. |
| Bin-emptying records | Collection route API | Records actual emptying, its source and its time. |
| Mass reconciliation | Collection route API | Compares planned, reported and confirmed masses. |
| Record completion | Collection route API | Checks the handover record and resolved discrepancies. |
| Device synchronisation | Separate background process | Processes stored work and external feedback. |
| Receiving facility | External boundary | Provides or confirms the evidence agreed for this case. |
Route assignment
- Runtime
- Collection route API
- Responsibility
- Links the bin, vehicle and collection work order.
Bin-emptying records
- Runtime
- Collection route API
- Responsibility
- Records actual emptying, its source and its time.
Mass reconciliation
- Runtime
- Collection route API
- Responsibility
- Compares planned, reported and confirmed masses.
Record completion
- Runtime
- Collection route API
- Responsibility
- Checks the handover record and resolved discrepancies.
Device synchronisation
- Runtime
- Separate background process
- Responsibility
- Processes stored work and external feedback.
Receiving facility
- Runtime
- External boundary
- Responsibility
- Provides or confirms the evidence agreed for this case.
Synchronisation is separate from finalising the evidence
Synchronisation is separate from finalising the evidence.
Each confirmed emptying takes effect once for the same bin and route work order. Completing a route requires documented handover status and resolved discrepancies.
Route assignments, bin-emptying events and handover records must express the same valid state. The exercise specifies the input and expected result.
- Alternative considered
- A separate service for every module spreads the business guarantee across additional network boundaries: each confirmed emptying takes effect once for the same bin and route work order, and completing a route requires documented handover status and resolved discrepancies.
- Trade-off
- Common schema changes require coordinated releases.
- Reassess
- A substantially different load for device synchronisation, or separate ownership, calls for a new division of runtime components.
Try it yourself
Classify route assignment, device synchronisation and the receiving facility as a module, process or external system. Justify the authoritative datastore.
A hint for your attempt
A domain responsibility becomes a process only when it has its own execution unit.
Compare with a possible solution
- Boundaries
- Route assignment is a module in the collection route API; device synchronisation is a separate process; the receiving facility is external.
- Storage
- The datastore for route assignments, bin-emptying events and handover records holds the authoritative evidence. Each confirmed emptying takes effect once for the same bin and route work order. Completing a route requires documented handover status and resolved discrepancies. The shared transaction protects this relationship; external responses remain separate evidence.
Apply to your project
Which planned service boundary would distribute a currently local guarantee across the network?