BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
178 / 279 · Module 12 — Idempotency and Duplicate Prevention · filtered: code← prev⊞ allnext →

12.26Optimistic concurrency

This is related.

Suppose two workers read version 10.

Worker A wants:

version 11
status = ACTIVE

Worker B wants:

version 11
status = SUSPENDED

Both write.

Who wins?

Without concurrency control:

last writer wins

Sometimes acceptable.

Sometimes disastrous.

Systems may use:

version field
ETag
timestamp
compare-and-set
optimistic locking

to detect conflicting updates.