B2.2 · dive 2 of 3
Property stores on ETS.
A system’s state is an :ordered_set :private table whose only key is a branded id — so a newest-first page and a time window come from the key, with no clock.
The idea
echo_data · bcs/property_store.exA system’s state is a property store: an ETS table created :ordered_set and :private, whose only key is the branded id and whose value is a property bundle. :private is the boundary — only the owning process reads it, so a lookup from outside raises rather than returning a forbidden row. put(store, id, value) writes the bundle under the id; get(store, id) reads it; record_entity notes that the system owns a name.
Because the id sorts as its mint instant sorts, :ordered_set keeps the table in time order, and the store needs no clock column. page_desc(store, n) reads a newest-first page by taking :ets.last and walking back through :ets.prev, n times; window(store, lo, hi) reads a time range as a key-range :ets.select. A feed and a window come from the shape of the key, not from a timestamp the system has to maintain.
The store also answers where a row belongs without a side table. placement(id) parses the id and routes it through hash32 — placement(USR0KHTOWnGLuC) is 234878118 — the same function that locates a cache shard or a partition. One placement idea, reused: the store, the cache, and the bus all address a row from its identity alone.
placement(USR0KHTOWnGLuC) → 234878118 native and pure agree parse(USR0NgWEfAEJfs) → {:ok, "USR", 320636799581945856} decode(USRzzzzzzzzzzz) → :error an overflow is refused, not wrapped
The three dives are in the module: B2.2 · Property Stores on ETS.
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 moduleordered_set term order, :private protection, :ets.last/:ets.prev/:ets.select
- King — Announcing Snowflake (2010)the time-high layout that makes the key a timeline
- Söderqvist — A new hash table (Valkey, 2025)the same key, costed at rest on the L2 store
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus