Quick tour
SEAM is easiest to understand from the outside in. A store is a directory; the directory holds files; the data files hold blocks; the blocks hold entries; and every entry is keyed by bytes whose first byte says what it belongs to.
Step by step
Section titled “Step by step”-
The store directory. One directory per database holds the sealed keyring
keys, the write-ahead log underwal/, the MANIFEST and the data files underdata/, and a few rebuildable caches. See Store layout. -
The data file. A
.stcfile is a run of sealed frames: data blocks, then a bloom filter, an optional stats frame, a block index, and a 96-byte footer at the very end. A reader starts from the footer. See SEAM data file. -
The block. Each data block stores the same entries either row by row (row block) or column by column (columnar block, using the column codecs). A frame wraps the block with a one-byte codec and format header, optional zstd or LZ4 compression, and the seal trailer.
-
The key. Entries are
(user key, timestamp, kind, value). The first byte of the user key picks the owner: the catalog, table rows, index entries, or postings. See the keyspace map.
One lookup, end to end
Section titled “One lookup, end to end”To read the value of a key at a timestamp, a reader does this.
- Open the footer: authenticate it, check the magic and revision, and learn where the bloom filter and index live.
- Ask the bloom filter whether the key can be in the file. A “no” ends the search in this file.
- Binary-search the block index for the first block whose last key is not less than the wanted
(user key, timestamp). - Read that frame, authenticate it with its AAD, decompress it, and decode the block.
- Within the block, find the newest entry for the user key whose timestamp is at or below the read timestamp. A tombstone hides older versions.
Writers do the mirror image: records go to the WAL first, are flushed into new data files, and a MANIFEST edit makes the new files live in one durable step.
Where to go next
Section titled “Where to go next”| If you want to | Read |
|---|---|
| Parse a store from scratch | Open sequence, then Reader checklist |
| Understand the encryption | Encryption at rest |
| Decode a data file by hand | Hex walk-through |
| See what changed between formats | Version matrix and Compare versions |
| Look up a term | Glossary |