When doing an UpdateItem on specific ddb record, if two separate clients attempt to update different attributes on the same record can race conditions still occur?
Example: consider a record
{
"foo": 1
"bar": 1
}
Client 1: Update - set foo = 2
Client 2: Update - set bar = 2
If both updates happen concurrently would it be possible for foo or bar to still be 1 because the last writer used an old version of the record?
For sure I can understand the advice that a condition expression is the way out of the problem but what I can't wrap by head around is if an update item request can potentially not be working with the most up to date version of a record, how on earth can a conditional expression on an update item be trusted to implement the optimistic locking? So for example if I set bar = 2 and can't trust the update to ensure the latest version of foo, how would could I trust a conditional expression which enforced an expected version of foo?