Master the fundamental concepts of storage fundamentals through this focused micro-challenge.
Write-ahead logging records intent in an append-only log before dirty pages hit disk. PostgreSQL WAL, SQLite rollback journal's successor, and RocksDB WAL all follow this pattern so crash recovery can redo committed work and undo incomplete transactions.
Each entry carries a type, transaction id, payload checksum, and length. Appends are sequential, matching SSD and HDD strengths.
cLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will append records to a WAL buffer and implement redo application on recovery. This exercise requires writing the log record before updating the in-memory page copy.
Write a C program that implements a simplified Write-Ahead Log.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github