Fork me on GitHub
#datomic
<
2019-06-22
>
tdantas13:06:02

hey guys, quick question suppose I have my application running ( 3 instances ) using datomic peer library. If I push data on application #1 and read data from application #2 , will the read be consistent with the latest data transacted ? ( reading my own write )

favila16:06:34

There’s possible network propagation delay. A peer will always see a consistent view for a specific t (no half-committed or stale reads), but one peer may know about a TX before another one

favila16:06:27

The sync function is to solve this problem

tdantas21:06:52

@U09R86PA4 how do you usually does on your system to the user read his own writes ? sticky sessions ? ( assuming we are not using peer server )

favila22:06:12

Return a t to the client; let the client use that t for future reads

favila22:06:21

Or just return the new record

favila22:06:33

In the POST that does the write

favila22:06:50

(Or whatever)

tdantas08:06:18

yeah, I’m returning the new record, but if the user refresh the page could reach a different application instance -> different db -> different attribute value

favila13:06:32

You can sync by time also

favila13:06:27

This is usually a difference of milliseconds not multiple seconds

tdantas13:06:57

from the documentation, datomic says “ACID compliant and fully consistent.” I’m assuming the transactor gonna publish to all peers the changes before ‘commit’ the value

tdantas13:06:03

is that correct?