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.
The three dives
each a leaf, the teachingThe branded id is the only key
A property store keeps one ETS table, and that table has exactly one key: the 14-byte branded id. There is no surrogate integer, no separate…
B2.2.2Key order is time order
Snowflakes are minted in time order, and base62 preserves that order byte for byte, so the ordered_set’s key order is chronological order…
B2.2.3TTL as structure, not bookkeeping
Expiry is usually per-entry bookkeeping — a stored deadline on every row, a sweep that visits them. EchoData.Buckets removes the…
The module, in one law
echo_data · property_store.ex, timeline.ex, buckets.exB2.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.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- Erlang/OTP — the ets modulethe ordered_set whose key order is range-queryable without a sort
- King — Announcing Snowflake (2010)time-ordered ids whose key order is mint order
- Kreps — The Log (LinkedIn Engineering)time-ordered, append-only data and rebuilding state by replaying it
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus