WEBVTT

00:00:00.500 --> 00:00:02.622
Every vault holds some kind of collection.

00:00:03.522 --> 00:00:06.127
We do not start from a list of data structures.

00:00:07.025 --> 00:00:09.252
We start from what the feature must promise.

00:00:10.150 --> 00:00:11.205
What does it hold?

00:00:12.103 --> 00:00:14.955
Which questions must it answer, and how exactly?

00:00:15.853 --> 00:00:17.897
What are we willing to accept in return?

00:00:18.796 --> 00:00:23.002
Staff need the overdue list, oldest first, and it must be exact.

00:00:23.900 --> 00:00:27.285
So the loan book is an ordered map, keyed by due day and then

00:00:27.298 --> 00:00:28.015
loan number.

00:00:28.913 --> 00:00:31.647
The list is a walk from the start of the map up to today.

00:00:32.546 --> 00:00:33.978
It answers in pages.

00:00:34.877 --> 00:00:38.158
Each page returns two loans and the key to continue from.

00:00:39.056 --> 00:00:40.580
The next call starts there.

00:00:41.478 --> 00:00:45.163
The map can change between calls, so a page is never a saved

00:00:45.176 --> 00:00:45.580
copy.

00:00:46.478 --> 00:00:48.431
The second choice we already made.

00:00:49.330 --> 00:00:51.634
Each branch owns its shelf as a module.

00:00:52.533 --> 00:00:55.267
The promise is the seal and the whole-branch lifetime.

00:00:56.166 --> 00:00:59.512
The cost is a limit on branches and a rule for closing one.

00:01:01.667 --> 00:01:05.039
Next season the library publishes a catalog: model number to

00:01:05.052 --> 00:01:06.120
deposit class.

00:01:07.020 --> 00:01:10.497
Every reader must see the same table until the next publication.

00:01:11.395 --> 00:01:13.049
Nobody edits one line.

00:01:13.947 --> 00:01:15.913
So the catalog is a frozen table.

00:01:16.812 --> 00:01:19.090
It is built once from the full sorted list.

00:01:19.989 --> 00:01:22.788
To change it, we build a new one and swap it in.

00:01:23.687 --> 00:01:25.653
The price is fixed-size entries.

00:01:26.551 --> 00:01:27.580
A number fits.

00:01:28.479 --> 00:01:31.617
A free-text description does not, and would live in an ordinary

00:01:31.630 --> 00:01:32.007
map.

00:01:32.906 --> 00:01:36.161
Desk asks for a safety briefing until a member has completed

00:01:36.174 --> 00:01:37.619
a loan of that kind of tool.

00:01:38.518 --> 00:01:41.551
The filter covers every completed loan in the exact history.

00:01:42.450 --> 00:01:43.596
Ask about a ladder.

00:01:44.494 --> 00:01:45.419
It says no.

00:01:46.317 --> 00:01:47.580
Briefing required.

00:01:48.479 --> 00:01:49.989
Now ask about the drill.

00:01:50.887 --> 00:01:52.242
The filter says maybe.

00:01:53.140 --> 00:01:56.447
Desk checks the exact history and finds a completed loan.

00:01:57.346 --> 00:01:59.221
No briefing required for the drill.

00:02:00.119 --> 00:02:02.137
This filter only gains entries.

00:02:04.267 --> 00:02:07.105
History records completed loans for later lookup.

00:02:08.006 --> 00:02:10.258
It grows faster than the active loan book.

00:02:11.157 --> 00:02:14.985
We want those records in stable memory, so History selects Hylix

00:02:14.998 --> 00:02:16.521
for its memory declaration.

00:02:17.420 --> 00:02:19.607
Loans keeps its own storage choice.

00:02:20.506 --> 00:02:23.657
History's implementation has an extra responsibility.

00:02:24.555 --> 00:02:28.839
It must explicitly transfer or retire each stored value it removes.

00:02:29.737 --> 00:02:31.690
Three things apply to every card.

00:02:32.589 --> 00:02:35.974
Each module memory picks its engine, and the default is fine

00:02:35.987 --> 00:02:37.967
until a requirement says otherwise.

00:02:38.865 --> 00:02:42.511
The frozen table and the filter come from Minima, which is experimental

00:02:42.524 --> 00:02:44.008
and needs setup in the root.

00:02:44.907 --> 00:02:47.797
And every collection gets a limit, written in the brief.

00:02:48.696 --> 00:02:51.105
None of these choices is a promise of speed.

00:02:52.003 --> 00:02:54.164
That, you measure on your own data.

