08. Write operations, idempotency and concurrency
Make writes repeatable without duplication and detect parallel changes before one system overwrites the other.
Robust integrations are not characterized by the fact that nothing ever goes wrong. They are characterized by the fact that the same step can be safely attempted again after an error.
The interface as a product
Idempotence permanently connects an external event with exactly one X-ERP process. RowVersion or a comparable version value protects against lost updates when users and integration work in parallel.
This makes the connection robust
- Generate a stable idempotency key for each business transaction.
- Before POST/Retry, search for this key and save the X-ERP ID.
- Before updating, read the current status and its version information.
- Submit only approved changes; treat conflicts as their own queue.
- Repeat only proven transient errors with limited exponential backoff and jitter.
- If there are technical errors, stop them and demand correction.
Prove production readiness
- The same request can arrive multiple times, but is effective once.
- Parallel user changes are recognized, not overwritten.
- The number of retries and the total duration are limited.
- Dead letter/clarification cases have context and ownership.
Mistakes that only become expensive during operation
- Every error is answered with Retry.
- PUT sends outdated entire object and deletes new values.
- Random UUID per retry prevents finding the original operation again.
This is what you take with you
Writing becomes a controlled state machine instead of a series of hopeful HTTP calls.
Related topics
- For integration specialists – connect APIs and external systems › 07. Connect receipts and warehouses in a controlled manner
- For integration specialists – connecting APIs and external systems › 09. Error diagnosis, logging and restart
- For integration specialists – connecting APIs and external systems › 10. Testing, acceptance and production operations
Frequently asked questions
**What does idempotent mean?**
Processing the same technical event multiple times leads to the same end state and not to a double effect.
**What is RowVersion used for?**
It shows whether a record has been changed since it was read and helps prevent lost updates.