Optimistic concurrency, increments and idempotency keys for records, actions and jobs
An update, a bulk update, an action run or an action's save can carry the record's updatedAt as it was read (ifUpdatedAt): the write is made only while that still stands, checked under the record's lock, and otherwise answers 409 version_conflict with the updatedAt now, so nothing a concurrent writer did is lost under yours. A number field takes increment(n), added to the stored value under the lock, for counters, stock and balances. Creates, upserts, bulk writes and action runs take an Idempotency-Key (the SDK's idempotencyKey), so a retried call makes nothing twice; and a job's dedupeKey, on enqueue, enqueueMany and POST /jobs, queues the work once per key.
A retry with the same Idempotency-Key and body within 24 hours gets the first answer back, marked Idempotent-Replayed: true; the same key with another body is 409 idempotency_conflict, and a retry while the first call still runs is 409 request_in_progress. Keys are scoped to the environment and the route. Answers of 500 and above aren't kept, so those retries run.
On the REST routes the precondition is the x-ib-if-updated-at header on PATCH, ifUpdatedAt beside a bulk update's id, or in an action's body; a run with a stale one is refused before the app is called. A job queued with a dedupeKey the environment already has a job for answers that job with 200.
The test harness honours all of it: a stale ifUpdatedAt throws the 409, increment adds, a repeated idempotencyKey replays, and a repeated dedupeKey returns the job.
More in Safe retries.