System Design Atlas

Predictive machine maintenance

10 / 10Worked example

Final design

Which tests prove contention protection and completion for maintenance findings in the overall architecture?

The final design retains the complete topology from step 6. Within the system boundary: interface → maintenance API → measurement windows, model references, findings and maintenance records; feature and model processing reads durably stored work from this datastore. Outside: sensor source. The processing receives or transmits the domain messages described in the main path; the result reaches the interface via the maintenance API. The proof plan complements maintenance finding B-30 with concurrency, retries, exact boundaries and terminal completion. The table specifies expected results for tests still to be run.

Starting point Closing a work order requires a maintenance report.

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.

Overall architecture with checks and review loops

Runtime topology · External entities, processes and datastores

  1. 1 · Sensor source → Measurement ingestion
  2. 2 · Measurement ingestion → Time-ordered measurement store
  3. 3 · Time-ordered measurement store → Feature and model processing
  4. 4 · Feature and model processing → Maintenance API
  5. 5 · Maintenance API → Relational maintenance store
Sensor sourceProvides authenticated measurement packages
Production planningtakes over released orders

Maintenance suggestion and work order

Measurement ingestionchecks source and deduplicates measurements
Time-ordered measurement storeMeasurements, gaps and origin
Feature and model processingReads closed windows
Maintenance APIManages findings, approvals and work orders
Relational maintenance storeFinding, decision and maintenance evidence
Maintenance interfaceShows the finding and review result
Sensor source → Measurement ingestionAuthenticated measurement package
Measurement ingestion → Time-ordered measurement storededuplicated measured value with time
Time-ordered measurement store → Feature and model processingClosed window
Feature and model processing → Maintenance APISuggestion with model revision
Maintenance API → Relational maintenance storeFinding and approval committed atomically
Maintenance interface → Maintenance APIhuman decision
Maintenance API → Production planningApproved command
Concurrency / Replay4 · 5 · 7
BoundaryMeasurement window [0, 60 s) · A measurement at 60 s belongs to the next window · 2

One finding per measurement window and model revision creates at most one work order approved by a human.

The sensor source feeds a time-ordered measurement store. Feature and model processing reads closed windows and produces suggestions linked to a model revision. The maintenance API manages relational findings, human approvals and work orders. Maintenance staff review findings through the interface, and production planning schedules approved work. Maintenance reports return as domain-reviewed feedback for later model evaluation. This learning case has no control path from the model process to the machine. The components and arrows match step 6. Test markers: API/commit → concurrency and replay (4/5/7); boundary check → exact boundary (2); domain role/completion → terminal evidence (9).

Test plan for the complete design

ComponentTest and expected resultReturn to an earlier step
Maintenance APIApproval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.Steps 3 and 5
Command journalIdentical retries take effect once; changed content produces a conflict.Steps 4 and 7
Domain boundary checkCheck values 59, 60 and 61 seconds. Oracle: 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.Step 2
Measurement windows, model references, findings and maintenance recordsAfter erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.Steps 5 and 9
Feature and model processingModel processing uniquely stores findings and window reference. Two examiners attempt release and rejection. The local version serializes the decisions; only the successful release commit creates a maintenance order.Steps 6 and 7

Maintenance API

Test and expected result
Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.
Return to an earlier step
Steps 3 and 5

Command journal

Test and expected result
Identical retries take effect once; changed content produces a conflict.
Return to an earlier step
Steps 4 and 7

Domain boundary check

Test and expected result
Check values 59, 60 and 61 seconds. Oracle: 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.
Return to an earlier step
Step 2

Measurement windows, model references, findings and maintenance records

Test and expected result
After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.
Return to an earlier step
Steps 5 and 9

Feature and model processing

Test and expected result
Model processing uniquely stores findings and window reference. Two examiners attempt release and rejection. The local version serializes the decisions; only the successful release commit creates a maintenance order.
Return to an earlier step
Steps 6 and 7

First end-to-end test and outstanding evidence

End-to-end path
A duplicate measurement window and conflicting reviews form the end-to-end test. Model processing uniquely stores findings and window reference. Two examiners attempt release and rejection. The local version serializes the decisions; only the successful release commit creates a maintenance order.
Clarify before extending the scope
Before real use, agree the sensor-source contract, retention, recovery targets and roles. All the limit values here are design assumptions. The proof table describes tests to be carried out; technical integration, browser testing and comprehension testing with readers follow separately.

Test a duplicate measurement window and a conflicting review end to end

Test a duplicate measurement window and a conflicting review end to end

Test a duplicate measurement window and a conflicting review end to end.

A model flags a maintenance need. Receiving the same measurement series twice must not create a second maintenance order. Completion requires technical and domain evidence.

Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order. The exercise specifies the input and expected result.

Alternative considered
An initial end-to-end path limited to lists and forms postpones the critical state checks.
Trade-off
The first end-to-end path needs controlled concurrency and failure points.
Reassess
Passing the counterexample tests and checks with readers provides grounds for extending the case.

Try it yourself

Choose two architectural decisions: concurrency protection and evidence-backed completion. For each, name the test, expected result and step to revisit.

A hint for your attempt

Link the markers of the overall architecture with the associated design steps.

Compare with a possible solution
Concurrency control
Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order. The invariant is expected: One machine finding per measurement window and model revision generates at most one approved maintenance order; a model output alone does not trigger a physical equipment effect. Deviation leads back to step 5 and to the command contract in step 4.
Test completion and retries
Initial state: an approved finding has exactly one maintenance order. Store the actual maintenance report and final review to complete the finding. Deliver the same measurement window with the same model revision again and attempt to approve the old finding again. Expected result: the finding remains complete, exactly one maintenance order remains, and the new approval receives a conflict. Only a new measurement window creates a new reviewable finding. Deviations lead back to step 9 for ownership and step 7 for the failure sequence.

Apply to your project

Which two counterexample tests will you run first in your own end-to-end implementation?

Transfer the architecture and counterexamples to the editable Markdown design template.

Start your own design

Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.

Download design template (.md)
Compare the ten tasks with the example case
  1. Purpose and boundary

    What proof of maintenance findings would arise in your own project outside of the application?

    In the example: A model suggestion receives a human review. Fictional suggestions for a single machine based on vibration trends, with human approval of work orders.

  2. Requirements

    Which rule of your project remains binding even with slow processing?

    In the example: Measurement quality is part of the finding. Measurement windows last 60 seconds, inclusive at the start and exclusive at the end; a measurement at exactly 60 seconds belongs to the next window.

  3. Scale estimates

    Which single item concentrates the load more than the daily mean value when required for maintenance?

    In the example: Test measurement rate and concurrent finding updates separately. An average of 10 events/s says little about 100 identical measurement-window deliveries for the same machine.

  4. Interfaces

    Which input fields make two change intentions different in your project?

    In the example: Approval identifies the measurement window and model revision. The machine, measurement window, model revision, finding and review result must remain identical on replay.

  5. Data and states

    Which states must remain protected in your model against late replay?

    In the example: The window and model version identify the finding. After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.

  6. Overall architecture

    Which planned service boundary would distribute a currently local guarantee across the network?

    In the example: Computation remains separate from the maintenance core. Measurement windows, model references, findings and maintenance records must express the same valid state.

  7. Critical flow

    What feedback could be missing even though the underlying action has already taken place?

    In the example: One approval commit creates one maintenance order. A machine finding per measurement window and model revision produces at most one approved maintenance order; a model output alone triggers no physical equipment effect.

  8. Bottlenecks and trade-offs

    Which similar display could have two different causes in your project?

    In the example: False alarm rates require confirmed feedback. A rising false-alarm proportion requires labelled feedback after maintenance review; a large computation backlog requires runtime measurements. More computation processes do not automatically improve model quality.

  9. Operations and security

    Which open state in your project needs a domain specialist as well as technical operations?

    In the example: Closing a work order requires a maintenance report. After erledigt or verworfen, an old suggestion creates no new order. A new measurement window receives a new finding.

  10. Final design

    Which two counterexample tests will you run first in your own end-to-end implementation?

    In the example: Test a duplicate measurement window and a conflicting review end to end. Approval and dismissal both expect version 2: in either order, one commit wins; the losing decision receives a conflict and creates no maintenance order.