I have a FaunaDB which I would like to interact with as a document store. I have a single api which:
- Reads an entire document from FaunaDB
- Mutates that data arbitrarily based on input to the api
- Writes the mutated back while guaranteeing the data has not been mutated
- Error or retry if the read was not current when attempting to write
In Postgres to guarantee consistency I would simply use a where clause. Since Fauna is distributed I assume the equivalent is more nuanced, for example my understanding is that CosmosDB writes idiomatically send the eTag of the read to check to guarantee consistency.