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

12.44Race condition scenario

Interviewer:

Two Mule workers receive the same customer at the same time. How do you prevent duplicates?

Good answer:

“I wouldn't rely on a query-then-create check because both workers can observe ‘not found’ before either creates. I'd prefer an atomic downstream uniqueness mechanism—such as a Salesforce unique External ID with Upsert—or another atomic unique constraint/claim mechanism.”

That is a very strong answer.