System Design Atlas

Research data and reproducible analysis

05 / 10Worked example

Data and states

Which changes to the analysis run must commit together, and what remains protected after completion?

The contracts require an authoritative data store for analysis run L-28. A content hash identifies bytes, not scientific truth. The example sums 2, 3 and 5 to 10; correcting the last value to 6 creates a new input hash and result 11. The original run remains reproducible. State and command result are stored together, preserving evidence of the same operation after restart.

Starting point A start key binds the complete manifest.

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.

Authoritative data and permitted state transitions

Entities, relationships and states

Run L-28Run manifest with three immutable hashes
Data set D-28Frozen input bytes with content hash
Recipe R-28Versioned analysis recipe with hash
Lauf L-28 → Datensatz D-28Uses unchangeable hash
Lauf L-28 → Rezept R-28Uses versioned recipe
1vorbereitet → laufend
2laufend → berechnet | fehlgeschlagen
3berechnet → geprüft → veröffentlicht
4veröffentlicht | fehlgeschlagen (terminal)

Business identity, content revision and aggregate version remain distinct.

A content hash identifies bytes, not scientific truth. The example sums 2, 3 and 5 to 10; correcting the last value to 6 creates a new input hash and result 11. The original run remains reproducible.

Domain entities and relationships

EntityAuthoritative attributesRelationship
Data setD-28; content hash, provenance and permitted scope of useImmutable input can be used by several runs.
Recipe revisionR-28; Algorithm and environment referenceA run binds exactly one recipe revision.
Analysis runL-28; manifest, budget and attemptProduces a result artifact or an evidenced failure outcome.
Result artifactHash, size and archive acknowledgementReferenced only after completeness and hash check.

Data set

Authoritative attributes
D-28; content hash, provenance and permitted scope of use
Relationship
Immutable input can be used by several runs.

Recipe revision

Authoritative attributes
R-28; Algorithm and environment reference
Relationship
A run binds exactly one recipe revision.

Analysis run

Authoritative attributes
L-28; manifest, budget and attempt
Relationship
Produces a result artifact or an evidenced failure outcome.

Result artifact

Authoritative attributes
Hash, size and archive acknowledgement
Relationship
Referenced only after completeness and hash check.

Permitted state transitions

Starting pointTargetPrecondition
vorbereitetlaufendInput, recipe and environment are frozen.
laufendberechnetResult was completely saved and checksum confirmed.
laufendfehlgeschlagenComputation error or runtime budget reached; no publication.
berechnetVerifiedReviewers confirm the comparison and provenance.
VerifiedveröffentlichtArchive acknowledges the same artifact hashes.
Published or failedterminalChanges start a new run; existing results remain versioned.

vorbereitet

Target
laufend
Precondition
Input, recipe and environment are frozen.

laufend

Target
berechnet
Precondition
Result was completely saved and checksum confirmed.

laufend

Target
fehlgeschlagen
Precondition
Computation error or runtime budget reached; no publication.

berechnet

Target
Verified
Precondition
Reviewers confirm the comparison and provenance.

Verified

Target
veröffentlicht
Precondition
Archive acknowledges the same artifact hashes.

Published or failed

Target
terminal
Precondition
Changes start a new run; existing results remain versioned.

Atomic changes and versions

Content reference
A content hash identifies bytes, not scientific truth. The example sums 2, 3 and 5 to 10; correcting the last value to 6 creates a new input hash and result 11. The original run remains reproducible.
Shared commit
The analysis API checks input hash, recipe hash, environment hash and budget, then writes the domain change, command result and any pending work in one transaction. Commit makes these changes durably visible together. A rollback before commit ends the attempt without partial effects.
Concurrency
Two publication commands expect version 5. Exactly one creates the publication job; the other receives a conflict. In the reverse order, the first commit still wins; identical content remains unchanged.
Terminal completion
New inputs do not modify published runs; a failed run restarts under a new run identifier.

Cover the full scope of the case

Concrete rule
Run completion and the budget timer compete on the same state. A complete result may commit only while server time < start time + 600 seconds. At the exact limit, the failure outcome wins; a late artifact remains unpublished and is retained as an attempt.

Derive storage needs from access patterns

Authoritative relational datastore
Immutable input can be used by several runs. A run binds exactly one recipe revision. The design therefore uses relational metadata with uniqueness constraints and short transactions. Historical revisions remain addressable; a rebuildable read model must not overwrite authoritative state.
Large content and measurement series
Immutable files reside in a separate artifact or document store; their hash references become available for approval only after the files are fully stored.

Artifacts remain immutably addressable

Artifacts remain immutably addressable

Artifacts remain immutably addressable.

Two publication commands expect version 5. Exactly one creates the publication job; the other receives a conflict. In the reverse order, the first commit still wins; identical content remains unchanged.

New inputs do not modify published runs; a failed run restarts under a new run identifier. The exercise specifies input and expected outcome.

Alternative considered
Separate unversioned changes allow an older state to overwrite the newer one.
Trade-off
Changes to analysis run L-28 are briefly serialised.
Reassess
Measured waits for 20 start requests on the same immutable run manifest justify reviewing 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
Two publication commands expect version 5. Exactly one creates the publication job; the other receives a conflict. In the reverse order, the first commit still wins; identical content remains unchanged.
Completion
New inputs do not modify published runs; a failed run restarts under a new run identifier.

Apply to your project

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

Next, computing processes are isolated from the metadata core.