Preventing race conditions with conditions
Two processes are trying to update the same user's email address simultaneously:
- Process A: Changes email from '[email protected]' to '[email protected]'
- Process B: Changes email from '[email protected]' to '[email protected]'
Both use updateitem() with ConditionExpression='email = :oldemail' where :old_email = '[email protected]'. Process A executes first and succeeds.
What happens when Process B executes immediately after?
Cet exercice fait partie du cours
Using Data Stores in AWS
Exercice interactif pratique
Passez de la théorie à la pratique avec l’un de nos exercices interactifs
Commencer l’exercice