Application-Consistent vs. Crash-Consistent Backups
What you'll learn: You'll understand the critical difference between application-consistent and crash-consistent backups and when each matters for database and stateful workloads.
The Core Difference
When backing up running systems, especially databases and stateful applications, the state of data in memory matters enormously.
Crash-consistent backups capture storage at a single point in time—like pulling the power plug on a running server. The snapshot includes whatever was written to disk, but in-flight transactions, cached writes, and uncommitted data in memory are lost. Think of it like taking a photo of a busy kitchen mid-service: plates are half-prepared, orders are partially cooked.
Application-consistent backups ensure the application's data is in a known, valid state before the snapshot. This involves signaling the application to flush buffers, complete pending transactions, and reach a consistent checkpoint. Like asking that kitchen to finish current orders and clear the stations before you photograph it.
Why This Matters for Databases
For a database like PostgreSQL or MySQL, a crash-consistent backup might restore successfully but require lengthy transaction log replays or recovery procedures. Worse, you might lose recent transactions entirely if they weren't yet written to disk.
An application-consistent backup uses database-aware hooks (often called VSS writers on Windows or application quiescing on Linux) to ensure all committed transactions are safely on disk and the database is in a recoverable state.
When to Use Which
- Application-consistent: Required for databases, enterprise applications, and any stateful workload where data integrity is critical
- Crash-consistent: Acceptable for stateless workloads, file servers, or when recovery time includes planned consistency checks
Key Takeaway: Application-consistent backups ensure your database and stateful applications can restore cleanly without data loss or corruption, while crash-consistent backups only guarantee point-in-time disk state—recovery may require additional repair steps or accept data loss.