Skip to content
Theory · How to Choose a Database · lesson 3 of 18

The LSM tree

The PostgreSQL ledger works like this: to correct an entry, the clerk walks to its page and corrects it in place. A B-tree is the same: a new key goes onto its own page, wherever that page is. While there are few entries, this is convenient.

In this lesson

  • Writing: memory and the log
  • Flushing to disk
  • Reading: from newest to oldest
  • Compaction
  • Where you meet it
  • Common mistake
  • Key points