jonnify·bcs /bcs/elixir-core/property-stores

B2 · module 2 of 6 · Property Stores on ETS

Property Stores on ETS.

One :ets table per system, keyed only by the 14-byte branded id; and because Snowflakes are minted in time order, the keyspace is already chronological — latest-N, windows, and cursors are range operations on the key.

Three dives: the branded id as the sole key, key-order-is-time-order and the reads that fall out of it, and TTL made structural by deriving a bucket from the id itself.

An ordered_set keyed by branded ids in mint order; the reads are ranges on the key. Select a part.
ordered_set — key = branded idBCS0ODq0WyQyk2 (value)BCS0ODq0WyQyk0 (value)BCS0ODq0WyQyjx (value)BCS0ODq0WyQyjw (value) newestoldestkey order = mint order latest(n)read off the topwindow(lo, hi)a range on the keyafter_cursor(id)the id is the cursor
readout · Select a part. The table is keyed only by the branded id; key order is mint order; latest-N, window, and cursor are all range operations on the key.
§1

The three dives

each a leaf, the teaching
§2

The module, in one law

echo_data · property_store.ex, timeline.ex, buckets.ex

B2.2 reads the property store as a data structure. Its one ETS table is an :ordered_set keyed only by the 14-byte branded id, and because Snowflakes are minted in time order, the keyspace is already chronological — latest-N, windows, and cursors are range operations on the key, with no timestamp column and no secondary index. Three dives: the branded id as the sole key, key-order-is-time-order and the reads that fall out of it, and TTL made structural by deriving a bucket from the id itself. Grounded in property_store.ex, timeline.ex, and buckets.ex, and pointed at the stores a Codemojex room keeps.

§4

The doors

the sibling courses
§4

References

sources · related

Sources

Related