sstable · shipping · also SSTable, SST file

Sorted string table

An SSTable is an immutable file of key-ordered records that can store all or part of a persistent sorted run in a log-structured storage engine.

Related Observatory article: Read on hesela.com

An SSTable is a file-level component, not an entire LSM-tree. A RocksDB nonzero leveled run can span several range-partitioned SST files. [2] In the reference log-structured implementation, compaction merges tables and can discard overwritten values or obsolete deletion markers when safe. [1]

The 2006 design that introduced the name describes an SSTable as a persistent, ordered, immutable map from keys to values. A table is a sequence of blocks, typically 64 KB each, followed by a block index at the end of the file. The index is loaded into memory when the table is opened, so a lookup can be served with a single disk seek. [4]

One documented file layout stores data blocks first, then meta blocks such as a filter block, a metaindex block, an index block with one entry per data block, and a fixed-length footer. The footer holds the metaindex and index block handles padded to 40 bytes, followed by an 8-byte magic number. [5]

In the same implementation a write-ahead log of about 4 MB is converted into a new level-0 table. Four level-0 files trigger a compaction, the combined size of level L (L of 1 or more) is limited to 10^L MB, and compaction output switches to a new table every 2 MB. [1]

Within a LevelDB data block, key-prefix compression uses indexed restart entries; this is separate from file-level block indexing and optional block compression. See SSTable restart point for lookup and reverse-traversal costs. [6] [7]

Relations

related
Log-structured merge-tree, Bloom filter, LSM tombstone, Ribbon filter, Partitioned filter, LSM compaction, Memtable, RocksDB MANIFEST, Sorted run, Prefix Bloom filter, Bourbon, SSTable restart point, ZenFS, LevelDB

Advantages

  • Because tables are immutable, concurrent reads of a table need no synchronization. [4]

Limitations

  • Deleted data is removed permanently only when obsolete tables are garbage-collected, not when the deletion is written. [4]
  • The implementation note shipped with LevelDB 1.23 estimates about 0.5 seconds for its non-L0 example of 26 MB read plus 26 MB written at an assumed 100 MB/s. Its approximately 5-second example instead throttles background writing to 10% of that rate. [1]

Citations

  1. LevelDB 1.23 implementation note: Sorted tables, Compactions and Timing. (accessed 2026-10-25)
  2. RocksDB project. Leveled Compaction: Structure of the files. (accessed 2026-10-25)
  3. Chang et al. Bigtable: A Distributed Storage System for Structured Data. OSDI 2006, sections 4 and 6 (accessed 2026-10-22)
  4. LevelDB project. Table file format: data, meta, metaindex and index blocks and footer (accessed 2026-10-22)
  5. LevelDB 1.23: BlockBuilder entry encoding and restart directory. (accessed 2026-11-12)
  6. LevelDB 1.23: Block::Iter Seek, Next and Prev. (accessed 2026-11-12)

Further reading

  1. Hesela: Bloom filters and the cost of an absent LSM lookup (accessed 2026-10-12)
Sources & caveats
  • bigtable is the OSDI 2006 paper by Chang et al. (Google), read in sections 4 and 6.
  • leveldb-table is the table format document of the reference implementation (Google), read in full.
  • leveldb, the implementation notes of the same project, was reread in full on the access date.
  • The LevelDB sizes and timing are historical documentation examples, not measurements from this review or bounds for current engines. The note distinguishes 14 MB read plus 14 MB written for L0 from 26 MB plus 26 MB for non-L0; the latter gives the approximately 0.5-second estimate. [1]
  • The run/file distinction uses RocksDB's documented nonzero leveled layout. [2]

JSON: /data/terms/sstable.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Sorted string table. Hesela. 2026-11-30. https://hesela.dev/terms/sstable/