SST Files
Build your understanding from first principles
Loading section...
Build your understanding from first principles
Why not just append to a file?
Just append data to a file. Every write adds a new line to the end. Fast for writes — but finding data is the problem.
To find a key, scan from the end backwards. Worst case: scan the entire file.
Append-only logs are O(n) for reads — we scan linearly. With 1 million entries, we might scan all 1 million just to find one key. We need a better way to organize data for faster lookups.
What if we sorted the data? Then we could use binary search...