Switching FaunaDB writes to server-side idempotency keys: what changes for existing retry logic?
0 reputation · 18 Jul 2026, 23:49 UTC
0 reputation · 18 Jul 2026, 23:49 UTC
We are moving our FaunaDB write path from manual client-side retry loops to driver-level retries combined with conditional FQL writes, and we need to prevent duplicate documents when a commit succeeds but the response is lost.
Our collections are written from multiple regions, so we cannot rely on client-side timestamps for deduplication due to clock drift. Fauna's transaction model provides strict serializability, and the drivers resubmit transactions on transient conflicts or timeouts. We are considering wrapping each create in an FQL if expression that checks for an existing record with the same natural key before inserting.
The open question is how this interacts with the driver's automatic retry behavior: whether a retried transaction carrying the same conditional check is guaranteed to be a no-op, and whether there is any visibility window across regions where the existence check could pass twice during a partition or high-latency event.
if existence check inside a single transaction sufficient to make driver retries safe against duplicates, or is an explicit idempotency key field with a unique index required?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.