Skip to the content.

1️⃣ Durable Databases (ACID-compliant)

If you are using a database that supports ACID transactions:

Recovery Mechanisms:

  1. Write-Ahead Logging (WAL)

    • Example: PostgreSQL, MySQL InnoDB
    • All changes are first written to a log on disk before applying to the data file
    • On crash → replay the log to recover committed transactions
  2. Checkpoints

    • Periodically flush data to disk
    • Combined with WAL → can recover to last committed state efficiently

Outcome:


2️⃣ Replication & Redundancy


3️⃣ Backups


4️⃣ Crash Recovery in In-Memory Systems


5️⃣ Application-Level Recovery


✅ Key Takeaways

  1. Committed data in durable systems can be recovered automatically after a crash.
  2. Uncommitted data is usually lost unless special techniques are used.
  3. Replication and backups improve resilience and reduce data loss.
  4. Crash recovery mechanisms depend on:

    • Database type (ACID vs NoSQL)
    • Logging (WAL, AOF)
    • Replication (single vs multi-region)

💡 Analogy: