Durability
Learn about implementation of the durability guarantee in ACID transactions.
Introduction
Durability guarantees ensures that once the transaction commits, the database ensures that the changes are permanent and available even in the event of a database crash. The definition of durability varies from one database to another and depends on how much data durability is required.
Durability strategies
There are multiple strategies to persist the data durably on disk.
Persistence to disk
The main memory is volatile and loses its contents during a power outage. Therefore, main memory is not used to store data permanently. Instead, applications persist the data on durable devices like disks to store it permanently. Disks are durable during power outages and keep the data intact.
Disks have a lifespan dictated by Mean Time to Failure (MTTF). For example, an HDD has a lifespan of 3–5 years, and an SSD has a lifespan of roughly ten years.
Note: Components of a disk can fail within this lifespan or can last beyond this, but the important point to remember is that disks come ...