It is from spec. All “standard” implementations must adhere to the spec.
And the same happens in Dgraph. Mutations are executed serially in the order they are present in the request.
No, in Dgraph each mutation runs in a separate transaction, which is committed before the next mutation in the operation is processed. This is what guarantees the behaviour that the spec expects:
This means that if we send two
incrementCreditsmutations in one request, the first is guarenteed to finish before the second begins, ensuring that we don’t end up with a race condition with ourselves.
I think, I answered it above. They are already separate.
Answered it at the start itself. Let me clarify it a bit more:
Mutations are executed serially in the order they are present in the request. Where execution of a single mutation consists of these steps in order:
- Creating a new transaction
- Running the mutation
- Committing the transaction
If any error happens in any of the above steps, then the rest of the mutations in the request are not executed.