Skip to content
Back to skills

Storage Engines

ASecurity

Storage-engine and database-internals architecture: B-tree vs LSM-tree, write- ahead logging, buffer/page cache, MVCC and concurrency control, durability/fsync, and compaction. Architect-level engine selection and data-path design. USE WHEN: designing or choosing a storage engine, "B-tree vs LSM", "WAL", "buffer pool", "MVCC", "compaction", "write amplification", "fsync/durability", embedded KV store, database internals, read/write-optimized store choice. DO NOT USE FOR: SQL query writing/O...

  • 31 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentsrustsqldatabase

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add claude-dev-suite/claude-dev-suite --skill storage-engines --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Storage Engines?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Storage Engines
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/claude-dev-suite-storage-engines/badge)](https://www.skillsdirectory.com/skills/claude-dev-suite-storage-engines)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: storage-engines
description: |
  Storage-engine and database-internals architecture: B-tree vs LSM-tree, write-
  ahead logging, buffer/page cache, MVCC and concurrency control, durability/fsync,
  and compaction. Architect-level engine selection and data-path design.

  USE WHEN: designing or choosing a storage engine, "B-tree vs LSM", "WAL",
  "buffer pool", "MVCC", "compaction", "write amplification", "fsync/durability",
  embedded KV store, database internals, read/write-optimized store choice.

  DO NOT USE FOR: SQL query writing/ORM (use database/orm skills); data pipelines
  (use `data-intensive`); vector indexes (use vector-stores skills).
allowed-tools: Read, Grep, Glob
---
# Storage-Engine Internals

## B-tree vs LSM-tree — the defining choice

| | **B-tree** (InnoDB, Postgres) | **LSM-tree** (RocksDB, Cassandra) |
|---|---|---|
| Writes | In-place; random I/O; write-amp from page writes | Sequential (memtable→SST); high throughput |
| Reads | 1 path, predictable | May touch many levels → read-amp (mitigate w/ bloom filters) |
| Space | Fragmentation | Space-amp until compaction |
| Best for | Read-heavy, range scans, point lookups | Write-heavy ingest, SSD-friendly |

The three amplifications (**write / read / space**) trade off against each other —
state which one the workload can least afford.

## Durability & the write path

- **WAL**: append before applying; `fsync`/`fdatasync` policy = the
  durability ↔ throughput knob (group commit amortizes fsync). `O_DIRECT` vs
  page cache; `fsync` correctness (don't trust it lying — the "fsync-gate").
- **Buffer/page cache**: hit ratio drives everything; eviction (LRU/CLOCK),
  dirty-page writeback, checkpointing to bound recovery time.
- **Crash recovery**: redo/undo, ARIES, checkpoints; recovery time vs steady-state.

## Concurrency control

- **MVCC** (snapshot reads, no read locks) vs 2PL (locking) vs OCC (validate at
  commit). MVCC needs version GC/vacuum (Postgres bloat).
- Isolation levels and their anomalies; SSI for serializable without heavy locks.

## When to recommend what
- Write-heavy ingest / time-series / SSD → LSM (RocksDB/Cassandra/ScyllaDB).
- Read-heavy, rich queries, range scans → B-tree (Postgres/InnoDB).
- Embedded/edge KV → LMDB (B-tree, mmap) or RocksDB (LSM) by read/write mix.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…