Data and states
What changes to maintenance findings must apply together, and what remains protected after completion?
The contracts require a authoritative datastore for maintenance finding B-30. The illustrative evaluation expects 600 measurements per minute. With 594 measurements, completeness is 99 %. A missing value is recorded as missing; an interpolated value must retain its origin. The release decision uses the findings and the documented data quality status. The state is stored together with its command result; this keeps the same change task visible after restart.
Starting point Approval identifies the measurement window and model revision.
Assumptions for the example case
Own fictitious example design. Fictional suggestions for a single machine based on vibration trends, with human approval of work orders. Measurement windows last 60 seconds and are closed on the left, open on the right; a measurement at exactly 60 seconds belongs in the next window. All figures and test goals are illustrative assumptions.
Authoritative data and permitted state transitions
Entities, relationships and states
Business identity, content revision and aggregate version remain distinct.
Domain entities and relationships
| Entity | Authoritative attributes | Relationship |
|---|---|---|
| Machine | M-30; sensor allocation | A machine has successive disjoint measurement windows. |
| Measurement window | Start, end, completeness, characteristics | The window is closed on the left and open on the right. |
| Model revision | R-30; model hash and release status | The finding identifies the exact model version used. |
| Maintenance findings | B-30; Machine, window, model, review result | Unique combination prevents duplicate orders. |
Machine
- Authoritative attributes
- M-30; sensor allocation
- Relationship
- A machine has successive disjoint measurement windows.
Measurement window
- Authoritative attributes
- Start, end, completeness, characteristics
- Relationship
- The window is closed on the left and open on the right.
Model revision
- Authoritative attributes
- R-30; model hash and release status
- Relationship
- The finding identifies the exact model version used.
Maintenance findings
- Authoritative attributes
- B-30; Machine, window, model, review result
- Relationship
- Unique combination prevents duplicate orders.
Permitted state transitions
| Starting point | Target | Precondition |
|---|---|---|
| Proposed | in_prüfung | Maintenance takes over the findings. |
| in_prüfung | freigegeben | Human review confirms the maintenance need. |
| in_prüfung | verworfen | The rationale records a false alarm or insufficient data. |
| freigegeben | erledigt | The actual maintenance report and final review are available. |
| erledigt or verworfen | terminal | New measurement windows produce new findings, not reopening. |
Proposed
- Target
- in_prüfung
- Precondition
- Maintenance takes over the findings.
in_prüfung
- Target
- freigegeben
- Precondition
- Human review confirms the maintenance need.
in_prüfung
- Target
- verworfen
- Precondition
- The rationale records a false alarm or insufficient data.
freigegeben
- Target
- erledigt
- Precondition
- The actual maintenance report and final review are available.
erledigt or verworfen
- Target
- terminal
- Precondition
- New measurement windows produce new findings, not reopening.
Atomic changes and versions
- Content reference
- The illustrative evaluation expects 600 measurements per minute. With 594 measurements, completeness is 99 %. A missing value is recorded as missing; an interpolated value must retain its origin. The release decision uses the findings and the documented data quality status.
- Shared commit
- Maintenance API checks machine, measurement window, model revision, findings and review result and writes domain change, command result and, if applicable, pending work in a transaction. Commit means that these changes will be permanently visible together. Before commit, a rollback ends the attempt without partial effect.
- Concurrency
- Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.
- Terminal completion
- After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.
Cover the full scope of the case
- Concrete rule
- The first full window runs from time 0 inclusive to 60 seconds exclusively. A measurement at 60 seconds belongs only in the second window. Repetition of a measurement is deduplicated before completeness counting; 594 unique measurements of expected 600 remain 99%.
Derive storage needs from access patterns
- Authoritative relational datastore
- A machine has successive disjoint measurement windows. The window is closed on the left and open on the right. The draft therefore selects a relational metadata store with uniqueness constraints and short transactions. Historical versions remain referenceable; a rebuildable read model must not overwrite the authoritative state.
- Large content and measurement series
- Derived views and extensive measurement or event histories are read separately according to their access patterns. Binding state decisions remain in the authoritative datastore.
The window and model version identify the finding
The window and model version identify the finding.
Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.
After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding. The exercise specifies the input and expected result.
- Alternative considered
- Separate unversioned changes allow an older state to overwrite the newer one.
- Trade-off
- Changes to maintenance finding B-30 are briefly serialized.
- Reassess
- Measurable waiting times for 100 identical measurement window deliveries for the same machine justify a check of the transaction duration.
Try it yourself
Explain the two possible winner orders in the case contract. Also determine the behaviour after terminal completion.
A hint for your attempt
Content revision and aggregate version have different tasks.
Compare with a possible solution
- Concurrency
- Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.
- Completion
- After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.
Apply to your project
Which states must remain protected in your model against late replay?