System Design Atlas

Social care case coordination across organisations

05 / 10Worked example

Data and states

Which state represents a copy that may have arrived without an acknowledgement?

The contracts require an authoritative store for support plan H-29. The lead organisation holds the full plan; partners receive only versioned extracts. Withdrawal blocks future disclosures. Received data requires a separately documented agreement about handling; the interface claims no remote deletion. State and command result are stored together so the same intent remains traceable after restart.

Starting point Handover binds the exact extract hash.

Assumptions for the example case

Own fictitious example design. A fictitious voluntary exchange of a specific section of the aid plan between two organisations. A release granted for 3600 seconds in the example is only valid for age < 3600 seconds. All figures and test goals are illustrative assumptions.

Authoritative data and permitted state transitions

Separate permission, receipt and investigation

Support plan H-29Leading master plan
Permission F-29Active or blocked
Handover U-29Receipt and extract hash
Investigation/deletion taskEvidence of handling and domain completion
Hilfeplan H-29 → Freigabe F-29Has versioned access permission
Freigabe F-29 → Übergabe U-29Authorises disclosure
Übergabe U-29 → Klär-/LöschauftragOpens upon revocation after possible receipt
1freigegeben → empfang_unbekannt before byte release
2freigegeben → widerrufen · no bytes
3empfang_unbekannt | übergeben → klärfall after withdrawal
4klärfall → abgeschlossen only with evidence of receipt and handling

Persist empfang_unbekannt before releasing bytes; withdrawal blocks new retrievals and preserves the possible receipt status.

The lead organisation stores the full plan; the partner receives only a versioned extract. Withdrawal blocks future disclosures. Data already received requires separately documented agreement; the interface claims no remote deletion.

Domain entities and relationships

EntityAuthoritative attributesRelationship
Support planH-29; lead organisation and revisionThe overall plan remains with the responsible case coordination.
Sharing permissionF-29; purpose, recipient, extract and validityAccess status is maintained separately from receipt and clarification; revocation remains effective even in the event of later receipt.
TransferU-29; extract hash and receipt evidenceA handover references exactly the released section.
Delegated taskPartner organisation, acceptance and outcomeCompletion binds outcome and responsible case coordination.
Investigation/deletion taskHandover reference, recipient, required action, evidence status and responsible rolesRemains open in case of unknown receipt or missing erasure document; never resets release.

Support plan

Authoritative attributes
H-29; lead organisation and revision
Relationship
The overall plan remains with the responsible case coordination.

Sharing permission

Authoritative attributes
F-29; purpose, recipient, extract and validity
Relationship
Access status is maintained separately from receipt and clarification; revocation remains effective even in the event of later receipt.

Transfer

Authoritative attributes
U-29; extract hash and receipt evidence
Relationship
A handover references exactly the released section.

Delegated task

Authoritative attributes
Partner organisation, acceptance and outcome
Relationship
Completion binds outcome and responsible case coordination.

Investigation/deletion task

Authoritative attributes
Handover reference, recipient, required action, evidence status and responsible roles
Relationship
Remains open in case of unknown receipt or missing erasure document; never resets release.

Permitted state transitions

Starting pointTargetPrecondition
entwurffreigegebenThe supported person confirms the extract, recipient, purpose and validity period.
freigegebenempfang_unbekanntPermission and version are checked; durably record U-29 as started before releasing the first bytes.
empfang_unbekanntübergebenAuthenticated partner acknowledgement matches U-29, recipient and extract hash; permission is still active.
freigegebenwiderrufenWithdrawal wins before disclosure starts; new retrievals are blocked.
empfang_unbekannt or übergebenklärfallWithdrawal blocks new retrievals and opens an investigation/deletion task regardless of acknowledgement status.
klärfallklärfallLate receipt or deletion evidence supplements the records; it neither reactivates permission nor automatically closes the case.
übergebenabgeschlossenThe partner's outcome is available; case coordination confirms completion of the delegated task.
klärfallabgeschlossenReceipt status and agreed handling are evidenced; required deletion or explicitly agreed retention is proven; case coordination and data protection officers confirm.
widerrufen or abgeschlossenterminalNo new content retrieval from old replay; conflicting late receipts are assigned to a linked clarification process.

entwurf

Target
freigegeben
Precondition
The supported person confirms the extract, recipient, purpose and validity period.

freigegeben

Target
empfang_unbekannt
Precondition
Permission and version are checked; durably record U-29 as started before releasing the first bytes.

empfang_unbekannt

Target
übergeben
Precondition
Authenticated partner acknowledgement matches U-29, recipient and extract hash; permission is still active.

freigegeben

Target
widerrufen
Precondition
Withdrawal wins before disclosure starts; new retrievals are blocked.

empfang_unbekannt or übergeben

Target
klärfall
Precondition
Withdrawal blocks new retrievals and opens an investigation/deletion task regardless of acknowledgement status.

klärfall

Target
klärfall
Precondition
Late receipt or deletion evidence supplements the records; it neither reactivates permission nor automatically closes the case.

übergeben

Target
abgeschlossen
Precondition
The partner's outcome is available; case coordination confirms completion of the delegated task.

klärfall

Target
abgeschlossen
Precondition
Receipt status and agreed handling are evidenced; required deletion or explicitly agreed retention is proven; case coordination and data protection officers confirm.

widerrufen or abgeschlossen

Target
terminal
Precondition
No new content retrieval from old replay; conflicting late receipts are assigned to a linked clarification process.

Atomic changes and versions

Content reference
The lead organisation stores the full plan; the partner receives only a versioned extract. Withdrawal blocks future disclosures. Data already received requires separately documented agreement; the interface claims no remote deletion.
Shared commit
The coordination API checks support plan revision, extract hash, recipient, purpose and permission reference, then writes the domain change, command result and any pending work in one transaction. Commit makes these changes durably visible together. Before commit, rollback ends the attempt without a partial effect.
Concurrency
Disclosure and withdrawal both expect version 3. Withdrawal first blocks disclosure without releasing data. Disclosure commit first stores empfang_unbekannt before transmitting bytes. Subsequent withdrawal blocks new retrievals and opens klärfall even without partner acknowledgement: a copy may already exist. A later acknowledgement supplements the evidence but reactivates no permission.
Terminal completion
Widerrufen is terminal only when disclosure has not started. After possible or confirmed receipt, klärfall stays open until case coordination confirms the actual outcome and data protection officers confirm the agreed handling. Required deletion needs authenticated partner evidence; explicitly agreed further retention needs its own documented scope and completion. Old replay results permit no new retrieval. Late conflicting evidence after abgeschlossen creates a linked investigation.

Cover the full scope of the case

Concrete rule
Check current permission before each new retrieval of content. The atomic boundary precedes the start of disclosure; a later withdrawal cannot reliably recover transfers already started or copies already received. Therefore, every started disclosure remains empfang_unbekannt until the matching acknowledgement. Withdrawal in empfang_unbekannt or übergeben always opens an investigation/deletion task with outstanding evidence. A missing ACK or timeout does not prove non-receipt.

Derive storage needs from access patterns

Authoritative relational datastore
The full plan remains with responsible case coordination. Permission limits future access; withdrawal has its own evidenced status. The design therefore uses a relational metadata store with uniqueness constraints and short transactions. Historical revisions remain referenceable; a rebuildable read view 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.

Receipt and permission remain separate evidence

Receipt and permission remain separate evidence

Receipt and permission remain separate evidence.

Disclosure and withdrawal both expect version 3. Withdrawal first blocks disclosure without releasing data. Disclosure commit first stores empfang_unbekannt before transmitting bytes. Subsequent withdrawal blocks new retrievals and opens klärfall even without partner acknowledgement: a copy may already exist. A later acknowledgement supplements the evidence but reactivates no permission.

Widerrufen is terminal only when disclosure has not started. After possible or confirmed receipt, klärfall stays open until case coordination confirms the actual outcome and data protection officers confirm the agreed handling. Required deletion needs authenticated partner evidence; explicitly agreed further retention needs its own documented scope and completion. Old replay results permit no new retrieval. Late conflicting evidence after abgeschlossen creates a linked investigation. Your test defines the input and expected result.

Alternative considered
Separate unversioned changes allow an older state to overwrite the newer one.
Trade-off
Changes to Help Plan H-29 are serialized briefly.
Reassess
Measured waiting times during concurrent handover and withdrawal justify reviewing transaction duration.

Try it yourself

Run withdrawal before the disclosure commit, then after byte release with a lost acknowledgement. Determine permission, receipt status and whether closure is allowed.

A hint for your attempt

Content revision and aggregate version have different tasks.

Compare with a possible solution
First test part
Withdrawal first blocks retrieval: no bytes are released and widerrufen is terminal.
Second test part
Disclosure first stores empfang_unbekannt. Withdrawal blocks further retrievals and enters klärfall with an open investigation/deletion task; possible receipt prevents terminal closure as a simple withdrawal.

Apply to your project

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

Next: the partner boundary has its own delivery contract.