AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Easydbmsacidtransactions

~60s

Surviving a crash

A transaction commits and the server loses power a second later. Which ACID property guarantees the committed changes are still present when the database restarts?

Show the answer and the worked solution

Correct answer: C.

Durability

Worked solution

  1. Atomicity guarantees a transaction is all or nothing, and isolation guarantees concurrent transactions do not see one another's intermediate state.
  2. Consistency guarantees a transaction moves the database from one valid state to another.
  3. Surviving a crash after a commit is exactly the promise of Durability, normally kept by forcing the log to stable storage before the commit is acknowledged.

Answer: Durability.

The idea

Map each ACID letter to the failure it defends against: atomicity against a mid-transaction abort, isolation against concurrency, durability against a crash.

Shortcut. Atomicity and isolation govern work still in progress and consistency governs valid states; only durability speaks about changes after the commit, which is when the power fails here.

Common trap. "Atomicity" is linked with crash recovery, but it concerns undoing uncommitted work as all or nothing, not keeping committed work.

Surviving a crash — OS, DBMS & Networks Aptitude Question

Surviving a crash: A transaction commits and the server loses power a second later. Answer and worked solution on CodeKairo.

Question

A transaction commits and the server loses power a second later. Which ACID property guarantees the committed changes are still present when the database restarts?

Options

  1. Atomicity
  2. Consistency
  3. Durability
  4. Isolation
Show the answer and the worked solution

Correct answer: C. Durability

Worked solution

  1. Atomicity guarantees a transaction is all or nothing, and isolation guarantees concurrent transactions do not see one another's intermediate state.
  2. Consistency guarantees a transaction moves the database from one valid state to another.
  3. Surviving a crash after a commit is exactly the promise of Durability, normally kept by forcing the log to stable storage before the commit is acknowledged.

Answer: Durability.

The idea

Map each ACID letter to the failure it defends against: atomicity against a mid-transaction abort, isolation against concurrency, durability against a crash.

Shortcut. Atomicity and isolation govern work still in progress and consistency governs valid states; only durability speaks about changes after the commit, which is when the power fails here.

Common trap. "Atomicity" is linked with crash recovery, but it concerns undoing uncommitted work as all or nothing, not keeping committed work.

All OS, DBMS & Networks questions · placement mock tests