SEAM 1
SEAM 1 is the layout that pre-4 used, adopted unchanged. It is the format every current LUMA build writes. A store becomes a SEAM 1 store at one durable point: the first open by a build of this format rewrites the MANIFEST and stamps it, before any other byte is written. See Rewrite and format stamp.
What SEAM 1 writers produce
Section titled “What SEAM 1 writers produce”| Structure | Written by SEAM 1 | Read-only (pre-release layouts) |
|---|---|---|
| Footer | revision 5, the layout of every file a current writer produces | revisions 1, 2, 3, 4 |
| Columnar block | revisions 3, 4, 5: a writer emits the lowest revision a block needs, so one file holds a mix | revisions 1, 2 |
| Stats frame | revision 2 | revision 1 |
| Posting block | 0xE2 (fallback), 0xE3, 0xE4, 0xE5 | unmarked and the early 0x02 marker of 0xE2 |
| MANIFEST header | 24-byte header | legacy 8-byte header |
What SEAM 1 readers accept
Section titled “What SEAM 1 readers accept”Every layout in the right-hand column above, so that stores written by pre-release builds can be opened. A SEAM 1 reader never reinterprets an older layout; it keeps a decoder for each. Background migration then rewrites or relabels old files, see Migration.
A SEAM 1 build refuses a store whose stamp is newer than it understands, before it writes anything: Compatibility rules.
Everything in SEAM 1
Section titled “Everything in SEAM 1”The lists below are generated from the same table as the version matrix.
Written by this version (130)
Conventions (5)
- Conventions — Integer encodings, counts, error classes and notation used by every page.
- varint — Unsigned LEB128, at most 10 bytes.
- zvarint — Zig-zag signed varint.
- count(limit) — A varint that must not exceed a stated limit.
- Error classes — Corrupt and NewerFormat, and when each applies.
Store layout (12)
- Store layout — The directory tree of a store and what lives where.
- File kinds — Which files are mutable, how each is sealed, and which are authoritative.
- Lifecycle and atomic install — How a data file becomes part of the store, and the startup sweep.
- Open sequence — The ordered steps a build performs when it opens a store.
- Small files — strata.lock, db.id, db.parent, archive.anchor and the keyring file.
- Derived caches — Rebuildable cache files that are never migrated.
- ZONES — Zone-map seeds cache.
- SPANS — Per-file value spans cache.
- TIERHEAT — Per-file read heat for the cold tier.
- cache.hot — Hot block list used for warm restart.
- rcache/ — Cold-tier frame cache.
- Spill runs — Temporary bulk-load and index-build sort runs.
Encryption (7)
- Encryption at rest — Algorithms and what is sealed.
- Key hierarchy — Master key, data keys, cluster keys and the auth key.
- Keyring file — The sealed keys file: header, body and rewrite rules.
- Seal trailer — The 32-byte trailer that ends every sealed region.
- Nonces and epochs — How nonces are built and why they cannot repeat.
- AAD per object — The additional authenticated data bound to each sealed object.
- Sealed caching_sha2 verifier — The 61-byte sealed catalog value for MySQL caching_sha2 passwords.
Write-ahead log (8)
- Write-ahead log — Segments, 4096-byte blocks and records.
- Segments — File names, preallocation and WAL format numbers.
- WAL block — The sealed 4096-byte block and its validity rules.
- Record framing — Length, CRC32C and the logical stream across blocks.
- Commit record — Timestamp, operations and the optional resolves id.
- Auxiliary record — Intent and cancel records marked by a zero timestamp.
- Durability modes — When a commit is acknowledged; the bytes do not change.
- Recovery — How replay accepts blocks and records.
MANIFEST (15)
- MANIFEST — The sealed version log: header, records and edits.
- Header (24 bytes) — Magic, manifest format, store stamp and generation.
- Reading and the torn tail — How records are read and where reading stops.
- Edit encoding — The byte layout of one version edit.
- File entry (add) — Level, id, size, entries, timestamps and key bounds of one added file.
- State and levels — How edits are applied and what each field means.
- Rewrite and format stamp — Why every open rewrites the MANIFEST and stamps the store.
- Tagged sections — The optional sections at the end of an edit.
- Tag 1: range table — Key-range table with read-write and read-only modes.
- Tag 2: global timestamps — Per-file global timestamp for ingested files.
- Tag 3: never written — A tag that decoders reject.
- Tag 4: GC floor — MVCC garbage-collection floor in microseconds.
- Tag 5: per-file stamp — The format stamp each data file conforms to.
- Tag 6: reserved — A reserved tag.
- Tag 7: range drops — Half-open key ranges that hide older data.
SEAM data file (29)
- SEAM data file — The immutable .stc file: frames, index, bloom, stats and footer.
- Frame — The 5-byte header, body and seal trailer shared by every section.
- Block index — Last key, timestamp, offset and length of every data block.
- Remote files and sidecar — Cold files in object storage and the local .stci tail.
- Per-file stamp — The format stamp recorded for each file in the MANIFEST.
- Reader invariants — What a reader must verify for every SEAM file.
- Footer — The 96-byte sealed footer at the end of the file.
- Footer flags — STATS, BLOOM_SKIP, BLOOM_RANGES and BLOCK_COUNTS.
- Choosing a footer revision — Legal flag combinations and the writer priority order.
- Footer revision 5: block counts — Stats frame with per-block version codes. The default for new files.
- Bloom filter — Split-block Bloom filter over user keys.
- Skip-tag tail — Keys whose first byte is a listed tag are not in the filter.
- Ranged tail — Keys that start with a listed prefix are not in the filter.
- Row block (format 0) — Prefix-compressed entries with restart points.
- Columnar block (format 1) — The same entries stored column by column, in five revisions.
- Layout of revisions 1 to 4 — Header, key columns, timestamps, kinds and values.
- Columnar revision 3: FSST — Adds the FSST bytes codec. Written when a block needs nothing newer.
- Columnar revision 4: key references — Integer value columns derived from a key field.
- Columnar revision 5: typed keys — Fixed-width key section split into integer fields.
- Value modes — Generic byte values versus row-shaped values.
- Column slot — Reference, tags, ints, floats, bools and bytes of one column.
- Key references — A column whose values equal a field of the key.
- Typed key section — Keys of equal length split into integer fields.
- Columnar limits — Entry, width, cell and size limits.
- Block stats frame — Per-block counts, bounds and column summaries.
- Stats revision 2 — Adds a version code per block.
- Column stats — Flags, counts, bounds per column.
- Versions code — How a block records whether it holds single versions.
- Zone maps — Derived at runtime from stats; no separate on-disk map.
Column codecs (19)
- Column codecs — The encodings used inside columnar blocks and frames.
- Column container types — Flat, IntCol, FloatCol and BytesCol.
- Packed integers — Minimum plus fixed-width bit-packing.
- zstd and LZ4 framing — Frame codec ids, length rules and writer policy.
- CONST — All values equal.
- FOR (frame of reference) — Packed offsets from a minimum.
- PATCHED — Packed base with a list of exceptions.
- DELTA — Absolute samples plus wrapping differences.
- RLE — Run values and run end positions.
- Integer DICT — Sorted distinct integers plus indexes.
- Float RAW — Plain 64-bit floats.
- ALP — Floats stored as scaled integers with exceptions.
- XOR — Floats stored as XOR of neighbouring bit patterns.
- Bytes PLAIN — Lengths, offset samples and concatenated bytes.
- Bytes DICT — A plain dictionary and indexes.
- FRONT — Front-coded byte strings.
- FSST — Symbol-table string compression.
- Scaled key fields (timestamp scale) — Typed-key fields stored as base plus granularity times value.
- How writers choose a codec — Writer heuristics, which are not part of the format.
Postings (9)
- Postings — Trigram and full-text posting lists and their five block revisions.
- Posting keys — List prefix and the sub-key families.
- Posting payloads — What each entry carries for trigram, document and full-text lists.
- Block head — The marker, revision byte, count and tier bounds.
- Posting revision 2: 0xE2 — Front-coded or numeric keys. The writer fallback.
- Posting revision 3: 0xE3 — Bit-split integer keys.
- Posting revision 4: 0xE4 — Multi-field tuple keys.
- Posting revision 5: 0xE5 — Wraps an inner block and adds term positions.
- Integer groups — Frame-packed integer runs used by revisions 3 and 4.
Key encodings (11)
- Key encodings — How logical rows, indexes and catalog entries map to keys.
- Internal key and MVCC — User key, timestamp, kind and ordering.
- Order-preserving values — The bytes encode_key_value emits.
- Keyspace map — What each first byte means.
- Table rows — Primary-key layout of row keys.
- Interleaved tables — Child rows stored under their parent.
- Row format v1 — The value layout shared by SQL and the columnar decoder.
- Index entries — Unique, non-unique and JSON-path index keys and values.
- Foreign keys — Reverse lookups reuse ordinary indexes.
- RESP keys — Key layout used by the Redis-compatible layer.
- Materialized view keys — View ids, cursor keys and groups.
Catalog records (15)
- Catalog records — Keys and values under the 0x00 prefix.
- Table definition — The encoded table record.
- Column definition — Name, type, flags and default.
- Index definition — Index id, name, kind and columns.
- Extension tags — The additive extension list at the end of a table definition.
- Ext R: relations — Foreign keys and the interleave parent.
- Ext S: schema — Column ids, fills and hidden columns.
- Ext M: metadata — SQL types, defaults and comments.
- Ext I: INCLUDE columns — Covering columns of an index.
- Ext D: DESC flags — Descending index parts.
- Ext C: compression — Per-table compression override.
- Ext B: bloom off — Tables created WITH (bloom = off).
- Ext V: materialized views — View id, building flag, name and SQL.
- Ext X: search options — Analyzer and positions trailer.
- Other catalog records — Users, grants, sequences, databases and blob metadata.
Read-only layouts (9)
These layouts exist in pre-release stores. SEAM 1 readers accept them so those stores can be opened and migrated, but SEAM 1 writers never produce them.
MANIFEST (1)
- Legacy header (8 bytes) — Generation only; read for stores created before the stamped header.
SEAM data file (7)
- Footer revision 1: plain — No bloom tail, no ranges, no counts.
- Footer revision 2: bloom skip — Bloom filter has a skip-tag tail.
- Footer revision 3: codec — The file contains an LZ4 frame.
- Footer revision 4: ranged bloom — Bloom filter has a ranged tail.
- Columnar revision 1: base — The base layout. Read only.
- Columnar revision 2: cross-column deltas — Integer columns stored as deltas against another column. Read only.
- Stats revision 1 — Per-block statistics without version codes.
Postings (1)
- Posting revision 1: unmarked — No marker byte. Read only.