.NET Architecture & System Design Interview Question #80

What is a non-repeatable read?

Transactions, CQRS, Event Sourcing & Distributed Consistency Mid-Level Intermediate

Quick Interview Answer

A non-repeatable read occurs when a transaction reads the same row twice and obtains different committed values because another transaction updated the row between the two reads.

Detailed Explanation

A non-repeatable read occurs when a transaction reads the same row twice and obtains different committed values because another transaction updated the row between the two reads.

Whether this is acceptable depends on the operation. Stronger isolation or snapshot techniques can provide a stable view when required.

Code Example

Tx A: READ Price -> 100
Tx B: UPDATE Price -> 120; COMMIT
Tx A: READ Price -> 120

Same row, different value.