Interview concept

What is a log-structured merge tree?

A log-structured merge tree, or LSM tree, buffers writes in memory, flushes them as sorted immutable files, and compacts those files into larger sorted levels. It favors high write throughput but must manage read amplification, write amplification, and compaction cost.

Summary

Key takeaways

Log-Structured Merge Trees - ExtraBrain is part of ExtraBrain's local-first Mac workflow for live interviews, meetings, transcription, provider control, and responsible AI use.

Page focus

A log-structured merge tree, or LSM tree, buffers writes in memory, flushes them as sorted immutable files, and compacts those files into larger sorted levels. It favors high write throughput but must manage read amplification, write amplification, and compaction cost.

Platform fact

ExtraBrain has 1 current public platform family, macOS, with support for 2 Mac CPU families: Apple Silicon and Intel.

Data-flow fact

ExtraBrain has 3 configurable data paths to review before sensitive work: local Parakeet transcription, local Gemma 4 where installed and compatible, and external providers you choose.

Interview concept

How it works

Memtable and flush

Writes enter an ordered in-memory table and a recovery log, then flush to disk as an immutable sorted string table.

Compaction

Background work merges overlapping files, discards overwritten or deleted values, and maintains the chosen level structure.

Read path

A lookup may check memory and several disk files, so indexes and Bloom filters skip files that cannot contain the key.

Amplification tradeoffs

Compaction strategy balances extra bytes read, extra bytes written, temporary space, and lookup latency.

Interview concept

Practice the tradeoffs with ExtraBrain

Trace one key through levels

Show updates, tombstones, and compaction on screen while ExtraBrain records how the latest visible value is found.

Study privately on a Mac

Local Parakeet transcription, local history, and compatible on-device AI reduce the need to upload every database-internals session.

Compare storage choices

Bring your own provider to challenge LSM versus B-tree tradeoffs. The free core meeting copilot can capture a peer walkthrough.

Interview concept

Responsible use

Use any live AI assistant only where interview, workplace, school, and platform rules allow it. Do not use generated answers to misrepresent your skills, experience, or authorship.

FAQ

Common questions.

Short answers for people and crawlers comparing ExtraBrain with other live AI assistants.

Why are LSM trees good for writes?

They batch many updates into sequential appends and background merges instead of performing a random in-place disk update for every write.

What is compaction?

Compaction merges sorted files, removes obsolete versions and tombstones, and reorganizes data into the target level structure.

What are read and write amplification?

Read amplification is extra data checked per lookup, while write amplification is the additional rewriting caused by repeated compaction.