System Design Atlas

Research data and reproducible analysis

04 / 10Worked example

Interfaces

How does the “Start run” contract distinguish a retry from new intent?

The load profile now meets the concrete command “Start run”. Its content includes input hash, recipe hash, environment hash and budget. An idempotency key identifies the same intent after a lost response; an aggregate version protects the changing domain state.

Starting point Size job volume and compute budget separately.

Assumptions for the example case

An original fictional design for a deterministic tabular analysis run with frozen input, recipe and environment. A compute job has a runtime budget of 600 seconds; at the limit it stops accepting new computation steps and is marked timed out. All figures and test targets are illustrative assumptions.

Commands, retries and current state

Command, Commit and Replay

CommandRun L-28 · Dataset D-28 · Recipe R-28
Command → Auswertungs-APICheck content and expected version
Analysis APIAccept the command or recognise a replay
Auswertungs-API → ErgebnisjournalCommit the result before responding
Result journalFingerprint + stored record

Identical content returns the stored record; altered content produces a conflict.

Starting a run binds the input hash, recipe hash, environment hash and budget. The same key returns the stored result; changed content causes a conflict.

Proposed API for this example

  1. POST/wissenschaftsdaten/{id}/commands

    Starting the run

    Input
    Input hash, recipe hash, environment hash and budget; expected aggregate version, authorised role and stable command key.
    Result
    Durably stored business result and new version; version or content conflicts produce no partial effects. An accepted external request receives an open status.
    Retry behaviour
    The key is scoped to the actor, operation and business object. After authentication, first compare the existing result and canonical content: identical content returns the stored evidence; changed content produces a conflict. Only new keys trigger validation of the current version.
  2. GET/wissenschaftsdaten/{id}

    Read the current business state and reason for investigation.

    Input
    Authorised identity and business object.
    Result
    Analysis run with current version, evidence and reason for pending processing.
    Retry behaviour
    Repeating a read creates no business change; access is checked again.

Additional state changes

OperationInputResult and protection
Complete the resultRun, attempt, result hash, size and versionOnly while running and before the budget expires; record the complete, verified artifact.
Fail the runError reason or budget reached, plus run versionLaufend → fehlgeschlagen; a late result cannot revert the state.
Confirming comparisonReviewer and exact input/recipe/environment/result hashesBerechnet → geprüft.
Publishing resultsReviewed run, archive destination and artifact hashesOne durable publication job; mark published only after the matching acknowledgement.

Complete the result

Input
Run, attempt, result hash, size and version
Result and protection
Only while running and before the budget expires; record the complete, verified artifact.

Fail the run

Input
Error reason or budget reached, plus run version
Result and protection
Laufend → fehlgeschlagen; a late result cannot revert the state.

Confirming comparison

Input
Reviewer and exact input/recipe/environment/result hashes
Result and protection
Berechnet → geprüft.

Publishing results

Input
Reviewed run, archive destination and artifact hashes
Result and protection
One durable publication job; mark published only after the matching acknowledgement.

Messages across the external boundary

Source contract
PROV distinguishes entities, activities and responsible agents. The specific hash binding and reproducibility tests are design choices in this example.
System responsibility
The compute process first writes the complete result to a temporary artifact area. The API commits the final reference only after verifying the hash. A crash beforehand leaves an incomplete attempt; a crash afterwards is reconciled against the same manifest.

A start key binds the complete manifest

A start key binds the complete manifest

A start key binds the complete manifest.

The start command may arrive again after a lost response.

Input hash, recipe hash, environment hash and budget must remain identical on replay. The exercise specifies input and expected outcome.

Alternative considered
A key stored only in volatile memory loses its evidence on restart.
Trade-off
The run-start journal requires durable retention and protected access.
Reassess
The documented retry window and journal volume determine the future archiving strategy.

Try it yourself

Predict the outcomes of an identical “Start run” retry, the same key with a different input hash, and a new key with an old version.

A hint for your attempt

Retry identity and current state require separate checks.

Compare with a possible solution
Identical
The stored result for analysis run L-28 is returned without repeating the effect.
Changed
The same key with altered canonical content results in conflict.
New intent with a stale version
A new key with a stale version is rejected before any business change. The interface reloads the current state and asks the user to confirm the decision again.

Apply to your project

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

Next: Artifacts remain immutably addressable.