flush-creates-sequential-sstables

Status: IN

Each `_flush` call creates an SSTable file with a strictly increasing sequence number (zero-padded filename for lexicographic = numeric sort), preserving newest-last ordering in `self._sstables`

Source: entries/2026/05/29/log-structured-merge-tree-lsm-_flush.md

Example

seq = len(self._sstables) + 1
path = os.path.join(self._dir, f"sstable_{seq:06d}.sst")
sst = SSTable.write(path, seq, sorted(frozen.items()))
self._sstables.append(sst)

JSON