4 ms·
Optimistic concurrency and a ledger lets you do those checks without locking any rows and you don’t have multiple processes fighting to update a single row. In
by stetrain 3y ago
Optimistic concurrency and a ledger lets you do those checks without locking any rows and you don’t have multiple processes fighting to update a single row.
Instead of leaving an AccountBalance row locked for the entirety of the Withdrawal process, you have a condition on the insert and a retry mechanism if that insert fails.
You still have to implement concurrency logic, it’s just less likely to have the database isolation be your bottleneck.