Describe the ACID properties of a database transaction.

Instruction: List and briefly explain the ACID properties that characterize a reliable transaction in a database system.

Context: This question evaluates the candidate's understanding of the key properties that ensure reliable processing of database transactions.

Updated

Example Answer

ACID describes a database transaction’s guarantees. Atomicity means its database changes commit together or are rolled back. Consistency means the transaction preserves the declared rules and constraints. Isolation governs how concurrent transactions interact, with different guarantees at different isolation levels. Durability means committed data survives the failures covered by the database’s configured durability contract.

For an order, I might atomically reserve stock and record an outbox event in the same database. Charging a remote payment provider is a separate side effect; rolling back the database cannot undo a completed charge. I would use an idempotent payment operation, track its result, and reconcile uncertain outcomes or apply a compensating refund when appropriate. I would also choose the isolation level deliberately: read committed is not equivalent to serial execution, and a serializable transaction may need to be retried after a conflict.

Why this works

It explains each property and draws the boundary around the actual database transaction, where the guarantees apply.

Follow-up to prepare for

If the payment request times out after the provider may have accepted it, how would you check its status before retrying?

Related Questions