Fork me on GitHub
#xtdb
<
2022-02-20
>
kraf11:02:44

I have no experience with XTDB but while reading up on it I started wondering if there was a delay between having written some piece of data and it showing up in reads. In something like PG I know when a transaction commits that it can be read immediately. In case it's the same with XTDB: does anybody know how this is solved? How would the transactor know that the caches (or at least the one on the same node) are up to date?

malcolmsparks11:02:47

If you need to read from your transaction, you can elect to await for it with await-tx.

kraf12:02:22

Ah ok that's great to know! What kind of latency would you expect when you await? And do you know how XTDB solves this problem? It seems rather challenging if you write to a log but read from caches

Jacob O'Bryant18:02:11

The caches/indexes are updated eagerly from the log, so it's fairly straightforward (at least from my perspective as a user!). I don't remember what I'm getting for latency off the top of my head, but I use await-tx regularly in my web app for rendering the next page after POST requests

👍 1
tatut08:02:39

but, you need to be careful with integrations... if you have a bulk import endpoint that does "fire and forget" you could DoS yourself with that

✔️ 1