We are building a web service with an idempotent create method and we are looking for approaches on how to implement idempotency.
The created objects have unique identifier properties, named Id
, which is a GUID type and assigned by the consumer.
We considered these approches:
1) Check if an object with the same Id
exists
2) Also include a Version
property and check if an object with the same Id
and Version
exists
3) Check if an object with the same Id
exis but get the object from the store, create hash of it and compare it to the hash of the incoming object
What would you recommand?