System Design Atlas

Digital lending with limited licences

07 / 10Worked example

Critical flow

A return waits for access revocation. Which conditions enforce this rule?

The service response may be lost after revocation.

Starting point Online access checks the authoritative entitlement.

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.

Lost return response

Lost return response

X-52 remains allocated until revocation for A-52 is confirmed.

Readers
Lending API
Licensed-copy inventory
Licensing worker
Licensing service
  1. 01 Readers → Lending APIReturn A-52
  2. 02 Lending API → Licensed-copy inventoryCommit rückgabe_offen
  3. 03 Licensing worker → Licensing serviceRevoke the entitlement
  4. 04 Licensing worker · Local processingResponse lost
  5. 05 Licensing worker → Licensing serviceReconcile A-52
  6. 06 Licensing service → Lending APIRevocation confirmed

Result: No reallocation before evidence arrives; then available once.

Status reconciliation uses the same loan identity.

Reader → API commit → worker → revocation; response lost; copy remains allocated; status reconciliation → release.

Commit, response loss and resumption

X-52 free
Attempt concurrent allocation to readers A/B and B/A → one winner, the other receives unavailable; exactly one allocation.
A-52 allocated
Identical replay, then a different reader under the same key → same loan for the replay; changed content produces a conflict.
Expiry = D-52
now=D-52−1 ms /D-52 /D-52+1 ms → access at the first instant is allowed while Active; access at the other instants is denied; the copy becomes available once.

A return waits for access revocation.

A return waits for access revocation.

Reconcile the same command.

The service response may be lost after revocation.

Unavailable, Return pending. Then Returned and available once; duplicate confirmation has no additional effect.

Alternative considered
Immediate reallocation before revocation evidence arrives creates overlapping rights.
Trade-off
The copy remains unavailable longer.
Reassess
Reliable service history improves reconciliation.

Try it yourself

Predict reallocation before and after revocation evidence arrives.

A hint for your attempt

The service response may be lost after revocation.

Compare with a possible solution
Before
Unavailable, Return pending.
Later
Returned and available once; duplicate confirmation has no additional effect.

Apply to your project

What is the equivalent of waiting for revocation before completing a return in your project?

Step 8: stale search results and lost licences are distinct. Which conditions guide diagnosis?