Optimistic vs Pessimistic Locking

Start Timer

0:00:00

Upvote
0
Downvote
Save question
Mark as completed
View comments

Let’s say we’re designing a workflow to update user account balances in a banking app, where each transfer involves deducting $100 from one account and adding it to another.

How would you implement this as an SQL transaction, and would you use optimistic or pessimistic locking to handle potential race conditions? Why?

.
.
.
.
.


Comments

Loading comments