Durability (ACID)

IT 위키
Betripping (토론 | 기여)님의 2024년 12월 11일 (수) 06:19 판 (Created page with "'''Durability''' is one of the four key properties in the ACID Properties of database transactions, ensuring that once a transaction has been committed, its changes are permanently saved in the database. This guarantees that data is not lost even in the event of a system crash, power failure, or hardware malfunction. ==Key Concepts== *'''Transaction Commit:''' Durability ensures that when a transaction is committed, its effects are persisted. *'''Non-...")
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

Durability is one of the four key properties in the ACID Properties of database transactions, ensuring that once a transaction has been committed, its changes are permanently saved in the database. This guarantees that data is not lost even in the event of a system crash, power failure, or hardware malfunction.

Key Concepts[편집 | 원본 편집]

  • Transaction Commit: Durability ensures that when a transaction is committed, its effects are persisted.
  • Non-Volatile Storage: Changes made by a committed transaction are saved to non-volatile storage such as a hard drive or SSD.
  • Crash Recovery: Mechanisms like Write-Ahead Logging (WAL) or checkpoints are used to recover committed transactions after a crash.

Mechanisms Ensuring Durability[편집 | 원본 편집]

Several techniques are employed to ensure durability:

  1. Write-Ahead Logging (WAL):
    • Ensures that all changes are logged before being applied to the database. Logs are stored in stable storage.
  2. Checkpoints:
    • Periodic snapshots of the database state are taken to minimize recovery time in case of a crash.
  3. Redundant Storage:
    • Data is replicated across multiple disks or servers to prevent data loss.
  4. Crash Recovery Algorithms:
    • Algorithms like ARIES help recover the database to the last consistent state after a failure.

Example of Durability[편집 | 원본 편집]

  1. A transaction updates a customer's account balance in a banking application.
  2. The database writes the update to a log (WAL) before modifying the actual data.
  3. The transaction is committed, ensuring the update is stored in non-volatile storage.
  4. Even if the system crashes immediately after, the recovery mechanism uses the log to restore the committed transaction.

Applications[편집 | 원본 편집]

Durability is critical in systems where data consistency and reliability are paramount:

  • Banking and Finance: Ensures that transactions like money transfers are never lost.
  • E-Commerce: Guarantees that orders and payments are persistently saved.
  • Healthcare: Protects critical patient records from being lost in system failures.
  • Enterprise Systems: Ensures the integrity of business-critical operations.

Advantages[편집 | 원본 편집]

  • Data Integrity: Prevents loss of committed data, ensuring database consistency.
  • Reliability: Builds trust in systems handling sensitive or critical information.
  • Crash Recovery: Reduces downtime by enabling automatic recovery.

Challenges[편집 | 원본 편집]

  • Performance Overhead: Durability mechanisms like WAL or replication can slow down write operations.
  • Resource Intensive: Requires additional storage and computational resources.
  • Implementation Complexity: Ensuring durability in distributed systems involves intricate protocols.

Related Concepts and See Also[편집 | 원본 편집]