Fork me on GitHub
#datomic
<
2018-11-24
>
samcgardner12:11:46

Question about the Datomic model - does Datomic seek to ensure that every node is at the same point in the transaction history? i.e. if I append to an existing Datom, is it legal for one node to return the Datom before append (and eventually converge on the new value as it reads more of the log) and another to simultaneously have read the log and return the appended value?

Dustin Getz14:11:42

@samcgardner I think all queries have a time-basis, so you will get strongly consistent results (i'm not sure what happens if the node doesn't have that time-basis, my system calls d/sync a lot to wait for catchup when necessary) https://docs.datomic.com/client-api/datomic.client.api.html#var-sync

4
samcgardner14:11:29

I believe you can use (datoms db arg-map) to request things without a time-basis if you want to

samcgardner14:11:31

If you use a single db you will of course observe consistency in your usage, I'm just interested in whether or not you're guaranteed to get the same db whichever backend ends up servicing your request at a time T

Dustin Getz15:11:00

Oh! d/db will return a dbval with the most recent time-basis known to the node. If this is important to your app, can you extend the time-basis all the way down to your api client, so the node can d/sync to exactly the right time basis every time?

samcgardner15:11:32

I'm just curious about the implementation in Datomic. I assumed it was going to be along those lines, since enforcing immediate consistency across all nodes seems needless according to the model, but wanted to validate my assumption. Thanks!