I am referring to the Dgraph paper while answering these questions.
- While your observation can be generally true, there is a fine difference that might need attention. As per the paper:
"When a transaction requests a
commit, Zero would check if any of those keys has a commit
timestamp higher than the start timestamp of the transaction.
If the condition is met, the transaction is aborted. "
Apart from the Start ts, there is a commit ts in play. So it can potentially mean that when A and B update a key simultaneously, the first one to commit will succeed. In other words, the start Ts alone does not guarantee ordering.
-
Dgraph will throw a “TxnConflictException”, a conflict exception, as soon as it detects one.
-
Dgraph reads are linearizable, so yes.