B1.3 · Choosing the ID System — manuscript chapter 1.3
Settled by the table.
The Branded Component System sends exactly one kind of value across every boundary, and beneath every boundary that value lands as a key in a hash table. Valkey 8.1 rebuilt that table from first principles — an open-addressing, cache-line-bucket design — and changed what an identifier costs at rest.
This module settles the chooser question on that ground: which ID system the BCS
standardizes on, decided by measurement rather than taste, with seven key shapes pushed through a million
keys each on the old table and the new. The chapter is content/bcs1.3.md; every figure is verbatim from
the committed outputs under bench/valkey-id/.
valkey_id_bench.out — among them
brd14 14 88 65 23 and uuid36 36 120 97 23. Select a shape; the readout prints
its row and computes the gap to the branded form.Why this chapter exists
content/bcs1.3.md · WhyTwo decisions of record frame the question. EchoMQ 2.0 is backed by Valkey through a custom optimized Elixir connector — so the engine under the bus is the engine whose economics matter. And EchoMQ 3.0 plans Streams with PubSub — so the identifier's cost inside a second data structure, the stream entry, is first-class now rather than later.
Between them sits the trading registry: every AST, TXN,
PRT, ORD, RSK, and STR identity this series mints
will live as keys, fields, and entries in this store, multiplied by every replica. A chooser settled by
folklore would be a tax on all of it; this one is settled by the table.
The evidence
bench/valkey-id/valkey_id_bench.outRedis against Valkey, both jemalloc 5.3.0, one million keys per shape, a
constant 8-byte value, used_memory delta per key after settle:
# engines: v=7.0.15 jemalloc-5.3.0 | v=8.1.8 jemalloc-5.3.0 | N=1,000,000/run | value=8B embstr fmt keylen redis7 valkey81 saved brd14 14 88 65 23 u64dec 19 104 73 31 uuid36 36 120 97 23 uuid16 16 104 65 39 ulid26 26 104 81 23 emq26 26 104 81 23 brd14+ttl 14 128 99 29
The branded form ties binary UUID-16 — 65 against 65 — while staying printable, typed,
and ordered; it beats its own decimal rendering, 65 against 73; the canonical UUID string pays two size
classes at 97; and the 26-byte emq:{q}:job: envelope lands at 81. jemalloc's 16-byte size
classes make cost a staircase, and the dives below read each step.
The verdict, in one line
content/bcs1.3.md · The chooserThe branded snowflake is the only row of the candidate table with every column filled — time-ordered, type-tagged, placed by in-contract arithmetic — and the measured table removed the last argument against it: the contract's wire form is also the cheapest printable one.
The dives
four lessons, fixed by the chapter specThe New Hash Table
The engine change: the retired chained dict against the 8.1 cache-line design — one
allocation, two memory reads — and the size-class staircase.
The Measured Table
Seven shapes, one million keys each; the four findings; the prefix budget as a design surface.
B1.3.3The Chooser
The candidate table; UUIDv7 the strongest outsider; the only row with every column filled.
B1.3.4The Streams Horizon
The entry-id injection; the 40960-entry replay window; the key recipes in Elixir and Go.
Consult this module when the economics bind: keyspaces in the millions per node, TTL-heavy families, and anything stream-shaped from now on. The verdict does not wait for scale to apply — the branded form is chosen for its contract properties first, and the storage layer's agreement removed the cost objection rather than creating the reason.
References
sources · relatedSources
- Söderqvist — A new hash tablethe open-addressing, cache-line-bucket design the chapter measures
- Valkey 8.1.0 GAthe release the hash table shipped in
- Valkey — Streams introductionentry-id structure; time ranges from the id
- Valkey — XADDexplicit ids, total order, the monotonic top-id rule
Related
- B1 — Ideas Behindthe chapter landing; the Part I arc
- BCS — the course homethe law, the id anatomy, the chapter map
- EchoMQ — the coursethe bus whose engine this chapter measures
- Redis Patterns Appliedthe substrate patterns these keys feed
- Functional Programming in Elixirthe umbrella where echo_data lives