Upserts in ludicrous mode

What you’re looking for is transactionality. While ludicrous mode does not provide those guarantees, the internal workings of Dgraph are such that all mutations go single-file (via Raft WAL). In normal mode, they get applied single file too. But, in ludicrous mode, they get multiplexed to (subject, predicate) combo. However, within the same (sub, pred), there is still serialization of the mutations. Therefore, most likely, you will end up with either “blue cat” or “green dog”.

But again, hard to know in advance, just considering ludicrous is NOT giving you transactions. Instead, it is more akin to Cassandra-style writes.

1 Like