System Design Atlas

Verify identity evidence and eligibility

05 / 10Worked example

Data and states

Which facts must remain consistent together?

A Boolean field such as `verified` loses the relationship between verification, purpose and validity. The relational model groups information around I-17 while storing verification attempts such as V-17, evidence such as N-17 and reasoned decisions such as D-17 separately. A request may exist temporarily without an attempt.

Starting point The interfaces distinguish task, attempt and decision; now their relationships and transitions are determined.

Assumptions for the example case

Example design: an operator, a verification provider and a specified purpose of use. Identity and other evidence shall be assessed separately. Login, sessions, and rights across multiple applications are not part of this case. Figures and target values are design assumptions; no real people are checked.

Connect request, attempt, evidence and decision

Test case I-17 · Relationships, cardinals and life cycles

Person P-17Domain identity
P-17 (1)I-17 (0..n)Delegated
Verification procedure I-17Purpose Z-3 · pending · current attempt V-17
I-17 is the root of dependent data sets
I-17 (1)V-17 (0..n)Owned
Test test V-17Provider Reference · Order · Own Status
I-17 (1)N-17 (0..n)Assigned to
Demonstration of evidence N-17Version · Origin · Retention Rule
I-17 (1)D-17 (0..1)leads to:
Decision D-17Result · Justification · valid until
V-17 1 → 0..n N-*An attempt can reference several pieces of evidence.
D-17 → Current V-17The decision identifies the applicable attempt and its evidence.
Order status · Cataloguecreatedpendingneeds_inputneeds_reviewcompletedexpiredImportant transitions: created → pending; pending → completed or needs_input or needs_review; needs_input → pending; needs_review → completed; open states → expired.
Decision resultPrerequisite satisfied | not satisfied · separate from request statusD-17 can be justified only for the effective test.
  • Aggregate root
  • Dependent domain data
  • Referenced person

I-17 is the leading parenthesis. An order can already exist before the first attempt; the result and the order state remain separate.

A relational SQL data store keeps the relationships and transitions product-neutral; sensitive evidence keeps its own storage.

Permitted transitions

Starting pointTriggersConsequence
created → pendingFirst attempt durably createdWait for evidence or a result. I-17 may remain in the created state without an attempt.
pending → needs_inputRequest for additional evidenceEnable a targeted new capture attempt.
needs_input → pendingNew capture completedAssign the new attempt to the same order and wait for its result.
pending → needs_reviewContradiction or unclear proofAssign a caseworker; do not confirm automatically.
pending / needs_review → completedReliable result and rule assessmentComplete order; save decision result `erfüllt` or `nicht erfüllt` separately.
created / pending / needs_input → expiredProcessing period reachedComplete old order; expressly create a new one.

created → pending

Triggers
First attempt durably created
Consequence
Wait for evidence or a result. I-17 may remain in the created state without an attempt.

pending → needs_input

Triggers
Request for additional evidence
Consequence
Enable a targeted new capture attempt.

needs_input → pending

Triggers
New capture completed
Consequence
Assign the new attempt to the same order and wait for its result.

pending → needs_review

Triggers
Contradiction or unclear proof
Consequence
Assign a caseworker; do not confirm automatically.

pending / needs_review → completed

Triggers
Reliable result and rule assessment
Consequence
Complete order; save decision result `erfüllt` or `nicht erfüllt` separately.

created / pending / needs_input → expired

Triggers
Processing period reached
Consequence
Complete old order; expressly create a new one.

Data rules

One-off event effect
A unique key protects E-17 in the inbox. The worker applies the event, decision result and update to the current I-17 in one atomic transaction. On failure, neither the decision nor the inbox completion takes effect.
Validity is not a test status
A completed order remains completed. D-17 carries the result `erfüllt` or `nicht erfüllt` as well as purpose and validity; a decision that satisfies the prerequisites can expire later or be revoked. During use, this status is re-evaluated.
Late feedback
An event for an old attempt must not overwrite a newer state. Uncertain ordering requires reconciliation with the provider.

Terms in this step

Transaction
Related data changes either take effect together or are rolled back together.

Try it yourself

Draw I-17, V-17, N-17 and D-17. Mark authoritative data, sensitive content, and atomic closure.

A hint for your attempt

Maintain the purpose and validity of the decision. A global verified flag loses this connection.

Compare with a possible solution
Authoritative relationships
I-17 connects P-17 and Z-3; V-17 documents provider interaction; N-17 refers to sensitive proof; D-17 stores result, reason and validity. The document images remain in the selected sequence at the verification service. Test: parallel incoming E-17 and status reading; both see either the old full state or the new full state.
Atomic completion
D-17 and the current status of I-17 are confirmed together or discarded together. The negative test breaks off between the two writes, after which no apparently completed job without D-17 must be visible.

Apply to your project

What relationships and state transitions does your system need to protect in a transaction?

In step 6, the data model is distributed among specific runtime responsibilities.