jonnify·bcs /bcs/ideas/id-system

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/.

The cost sheet. Bytes per key, one million keys per shape — Redis (grey) beside Valkey (blue; the branded form in red). Select a shape to read its measured row.
Redis Valkey 88 65 brd14 104 73 u64dec 120 97 uuid36 104 65 uuid16 104 81 ulid26 104 81 emq26 128 99 brd14+ttl
readout · The fixed dataset is the seven measured rows of 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.
§1

Why this chapter exists

content/bcs1.3.md · Why

Two 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.

§2

The evidence

bench/valkey-id/valkey_id_bench.out

Redis against Valkey, both jemalloc 5.3.0, one million keys per shape, a constant 8-byte value, used_memory delta per key after settle:

content/echo_data/bench/valkey-id/valkey_id_bench.out · verbatimfrozen
# 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.

§3

The verdict, in one line

content/bcs1.3.md · The chooser

The 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.

§4

The dives

four lessons, fixed by the chapter spec

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.

§5

References

sources · related

Sources

Related