System Design Atlas

Digital lending with limited licences

05 / 10Worked example

Data and states

An unknown outcome keeps the licence allocated. Which conditions enforce this rule?

The service may already have issued the entitlement.

Starting point commandKey returns the existing A-52.

Assumptions for the example case

A fictional library with one licensed copy and reading devices that verify entitlements online. Every new read checks the current entitlement; offline use is outside the scope. All quantities, thresholds and operational targets in this design are illustrative assumptions.

Allocated until evidence arrives

Allocation and alternative terminal paths

Title T-521 title
Copy X-520..1 current allocation
Licence pendingUnknown outcome
Activeto D-52
FailedConfirmed non-issuance
Return pendingStill allocated
ReturnedCopy free
Expirednow ≥ D-52
Titel T-52 → Exemplar X-521:1 in the example
Exemplar X-52 → Lizenz offenAllocate atomically
Lizenz offen → AktivIssuance confirmed
Lizenz offen → GescheitertAlternative terminal states
Aktiv → Rückgabe offenReturn requested
Rückgabe offen → ZurückgegebenRevocation confirmed
Aktiv → AbgelaufenTime limit

T-52 has 1:n loans; X-52 belongs to at most one active or unresolved loan at a time.

Licence pending → Active → Return pending → Returned; confirmed non-issuance and expiry provide alternative terminal paths.

State transitions and completion

Starting pointCondition and effectSubsequent state
RequestedCopy allocated atomicallyLicence pending
RequestedNo free copyRejected
Licence pendingMatching licence confirmationActive
Licence pendingThe service confirms that no entitlement was issued.Failed; copy available
ActiveReturn requestedReturn pending
Return pendingOnline entitlement revocation confirmedReturned
ActiveExpiry instant reached; online checks deny accessExpired

Requested

Condition and effect
Copy allocated atomically
Subsequent state
Licence pending

Requested

Condition and effect
No free copy
Subsequent state
Rejected

Licence pending

Condition and effect
Matching licence confirmation
Subsequent state
Active

Licence pending

Condition and effect
The service confirms that no entitlement was issued.
Subsequent state
Failed; copy available

Active

Condition and effect
Return requested
Subsequent state
Return pending

Return pending

Condition and effect
Online entitlement revocation confirmed
Subsequent state
Returned

Active

Condition and effect
Expiry instant reached; online checks deny access
Subsequent state
Expired

An unknown outcome keeps the licence allocated.

An unknown outcome keeps the licence allocated.

Release only after confirmed non-issuance or access revocation.

The service may already have issued the entitlement.

Confirmed non-issuance → Failed, copy available. Licence pending keeps the copy allocated until matching evidence arrives.

Alternative considered
Releasing on timeout can create overlapping entitlements.
Trade-off
Waiting time reduces availability.
Reassess
A service without status queries requires a manual process.

Try it yourself

Draw the paths for confirmed non-issuance and an unknown issuance outcome.

A hint for your attempt

The service may already have issued the entitlement.

Compare with a possible solution
Confirmed
Confirmed non-issuance → Failed, copy available.
Unknown
Licence pending keeps the copy allocated until matching evidence arrives.

Apply to your project

What is the equivalent of retaining allocation while the outcome is unknown in your project?

Step 6: the index grants no permissions. Which conditions enforce this rule?