System Design Atlas

Digital lending with limited licences

03 / 10Worked example

Scale estimates

Search dominates the load. Which conditions determine the design?

Many people search without borrowing.

Starting point Online access requires now<D.

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.

Search versus allocation

Search versus allocation

Search50.000
Allocation1.000
Ratio50:1
Duration14 days

50 searches per allocation; 14 days equals 1,209,600 seconds.

50:1 search-to-allocation ratio; 14 days = 1,209,600 s duration.

Illustrative load and domain calculations

  1. 01

    Loan duration

    1,209,600 seconds

    14 days ×24 h ×3,600 s

    For the designStore expiry as an unambiguous UTC instant.

  2. 02

    Search load

    50 searches per allocation

    50,000 searches / 1,000 allocations

    For the designThe search index may lag; allocating the last licence requires a transaction.

Search dominates the load.

Search dominates the load.

Size the index and allocation path separately.

Many people search without borrowing.

14×24×3,600=1,209,600 s. 50,000/1,000=50 searches per allocation.

Alternative considered
Including every search in the licence transaction increases lock contention.
Trade-off
The index may lag.
Reassess
Measured incorrect availability indications determine projection updates.

Try it yourself

Calculate duration and load ratio.

A hint for your attempt

Many people search without borrowing.

Compare with a possible solution
Duration
14×24×3,600=1,209,600 s.
Ratio
50,000/1,000=50 searches per allocation.

Apply to your project

What is the equivalent of search dominating load in your project?

Step 4: retries preserve the same loan. Which conditions enforce this rule?