HomeDistributed & Parallel ComputingWrite-Ahead Logging: How Databases Survive a Crash

📝 Write-Ahead Logging: How Databases Survive a Crash

Explore write-ahead logging (WAL), the protocol that lets PostgreSQL, MySQL, and filesystems guarantee durability and recover instantly after a crash.

Distributed & Parallel Computing3DModerate60 FPS
write-ahead-log-lab ↗ Open standalone

This simulation shows how a database writes sequential log records before applying changes to data pages, and how a simulated crash and recovery pass replays the log to restore a consistent state.

🔬 What It Demonstrates

This simulation shows how a database writes sequential log records before applying changes to data pages, and how a simulated crash and recovery pass replays the log to restore a consistent state.

🎮 How to Use

Trigger writes to append log entries, watch checkpoints apply them to the data files, then force a crash at any moment to see the redo/undo recovery process play out.

💡 Did You Know?

PostgreSQL's WAL and MySQL's InnoDB redo log both use this exact pattern, and the same idea powers journaling filesystems like ext4 and NTFS that protect your files from corruption during power loss.

⚙ Under the hood

Explore write-ahead logging (WAL), the protocol that lets PostgreSQL, MySQL, and filesystems guarantee durability and recover instantly after a crash.

databaseswalwrite-ahead-loggingpostgresqlmysqldurabilitycrash-recoverysystems

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)