A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Checkpointing: Sharp and Fuzzy Checkpoints

College Depth 97 in the knowledge graph ☐ I know this ☆ Set as goal
399prerequisites beneath it
See this on the map →
Crash Recovery: Undo and Redo LoggingWrite-Ahead Logging and Database Recovery→
checkpoint fuzzy-checkpoint recovery-time log-truncation

Core Idea

Checkpoints create known good states for faster recovery. Sharp checkpoints stop all activity and flush dirty pages, creating precise recovery points but causing long pauses. Fuzzy checkpoints allow transactions to continue while recording which pages are being flushed, reducing latency but complicating recovery. Checkpoints also truncate logs, discarding records for committed transactions, preventing infinite log growth.

Explainer

You already know that write-ahead logging (WAL) ensures durability by recording every change in a log before modifying the actual data pages, and that crash recovery replays or undoes log entries to restore the database to a consistent state. But consider what happens if the system has been running for months — the log could contain millions of entries. Replaying from the very beginning on every crash would be catastrophically slow. Checkpointing solves this by periodically creating a known-good synchronization point between the log and the data on disk, so recovery only needs to process log entries after the most recent checkpoint.

A sharp checkpoint (also called a consistent checkpoint) is the conceptually simple approach: pause all transaction processing, flush every dirty page in the buffer pool to disk, write a checkpoint record to the log, and then resume. After a sharp checkpoint, every committed transaction's changes are safely on disk, and recovery can ignore all log entries before the checkpoint record. The problem is obvious — the system is completely unavailable during the flush. If the buffer pool is large and many pages are dirty, this pause can last seconds or even minutes, which is unacceptable for production systems.

Fuzzy checkpointing eliminates the pause by allowing transactions to continue while dirty pages are flushed in the background. The checkpoint record notes which pages are dirty at the time the checkpoint begins and where each active transaction stands. Pages are then written to disk asynchronously while new transactions modify other pages freely. The tradeoff is that the checkpoint no longer represents a perfectly consistent snapshot — some pages on disk are from before the checkpoint, others from after. Recovery must account for this by using the checkpoint's dirty page list and active transaction table to determine exactly where to start replaying the log. The ARIES recovery algorithm, used in most commercial databases, is specifically designed to work with fuzzy checkpoints.

Checkpointing also serves a second critical function: log truncation. Without checkpoints, the WAL would grow without bound because you could never be sure which log records might be needed for recovery. A checkpoint establishes that all data up to a certain log sequence number (LSN) is safely on disk, so log records before that LSN can be archived or discarded. In practice, databases maintain a "minimum recovery LSN" derived from the checkpoint's record of the oldest active transaction and the oldest dirty page — no log record before this point is needed for crash recovery. This is what keeps the active log at a manageable size, even in systems that process millions of transactions per day.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Assembly Language Basics → Memory Organization and Addressing → Memory Hierarchy → Memory Management Fundamentals → Buffer Pool Management and Cache Replacement Policies → Crash Recovery: Undo and Redo Logging → Checkpointing: Sharp and Fuzzy Checkpoints

Longest path: 98 steps · 399 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.