# 5.3 The Housekeepers (BGWriter & Checkpointer)

A warehouse full of millions of busy soldiers can get dirty very quickly. Every time a suitcase is updated (Chapter 4), the page on the **[[Chapter 5/5.1 - The Warming Rack|Warming Rack]]** becomes "dirty"—it’s different from the original version in the basement.
If the room loses power, those warm, modified pages disappear forever. To prevent this, the elephant employs a dedicated staff of **Housekeepers**.
## 1. The Background Writer (The Stealth Cleaner)
The **Background Writer** is a quiet elephant who tip-toes around the Warming Rack. His entire job is to look for dirty pages that haven't been touched in a while and gently write them back to the basement *before* anyone actually needs the space.
By doing this "just in time," he ensures there are always a few clean, cold spots on the rack ready for the next soldier, so no one has to wait for a "clean-up" in the middle of a battle.
## 2. The Checkpointer (The Grand Sync)
While the Background Writer is a stealthy cleaner, the **Checkpointer** is the foreman. At regular intervals, he rings a massive bell.
_"Everybody stop! We're doing a total sync!"_
He ensures that *every* change mentioned in the **[[Architecture/WAL|Sequential Diary (WAL)]]** has been successfully written into the filing cabinet in the basement. Once he is done, he draws a line in the diary and says, "We are safe up to this point."
## The Checkpoint Spike
If the Checkpointer is too aggressive, he can clog the elevator to the basement, causing everyone else to freeze. This is why tuning the "Housekeeping Schedule" is the most important part of maintaining a happy, lazy elephant.
Without these housekeepers, the elephant would eventually be buried in a mountain of dirty suitcases, and his "Lazy" lifestyle would come to a crashing, data-losing halt.
---
[[Chapter 5/5.2 - The Private Desk|← 5.2 - The Private Desk]] | [[Chapter 5/5.0 - The Hunger of Resources|↑ 5.0 - The Hunger of Resources]] | [[Chapter 6/6.0 - The Waiting Game|6.0 - The Waiting Game →]]