Any xtdb love?

I watched Workshop video: A deep dive into XTDB with Jeremy Taylor (2021-12-02)
And then, I was interested so I went through the fun tutorial.

Has anybody here used it for projects?

3 Likes

Iā€™m using it at work (have been using it since last year). Itā€™s very nice and ā€œcomfortableā€ to work with. The Datalog dialect it uses is a bit different than Datomicā€™s, and the fact that itā€™s document-oriented also gives a different feel. There are some rough edges sometimes, but overall, Iā€™m pleased with it. Also, the guys at Juxt (and especially @refset ) have been super helpful and responsive.

3 Likes

I use it in my bootstrapped startup, and also in Biff, a web framework I made. (The startupā€™s built on Biff). Biff is due for an update; hopefully thatā€™ll happenā€¦ sometime. Very happy with XTDB.

Cool that several have used it for projects, even though it is a quite new db.

Weā€™ve been experimenting with it in Spacy, with a Postgres for the log and document storage. Very happy with it so far. Weā€™re still trying to figure out the best way to structure our documents in order to avoid conflicts upon concurrent writes.

Concurrency can get ugly indeed. My naĆÆve assumption would just be that the xtdb transaction log makes it easier to deal with, and the ā€˜winnerā€™ of a concurrent write is just which ever happens to be last in system timeā€¦

Precisely. That works like a charm if you store a history of domain events as separate documents. Naively saving the current state of your entire entity comes at a risk of losing some writes though. So far ::xt/match has helped us enforce consistency, but weā€™re curious if thereā€™s a better approach.

Have you looked at transaction functions? I use matches + retries on match failure myself, with the idea that I can always switch to transaction functions if I have any writes that start having a lot of contention.

1 Like

Do you mean using a transaction function that would behave like clojure.core/compare-and-set! and replace the document only if no concurrent writes took place? No, I havenā€™t considered it; thanks for the hint!

Yes, pretty muchā€¦ Pretty much all update logic should live in transaction functions, at least thatā€™s how Iā€™ve been using it, and I havenā€™t had problems with race conditions (other than a bug in the kafka backend, which was promptly fixed by the JUXT guys pretty much as soon as I reported it).

replace the document only if no concurrent writes took place?

That sounds more like using match; for transaction functions, they get evaluated sequentially at index time, so there arenā€™t any concurrent writes to compete with.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.