My understanding of XTDB (Immutable Databases)

https://youtu.be/HG-3xUGp5Ao

#Clojure #Programming #Database #XTDB

My understanding of XTDB (Immutable Databases)

YouTube

Anyone done work with #XTDB? It looks awesome to me, and the few hours I got to spend playing with it last night only made me more convinced. But obviously a huge difference between trying out a DB for fun and having to maintain one in production. So I would love to hear from anyone with experience in the latter. Or in lieu of that, someone else who have used it for fun :)

https://github.com/xtdb/xtdb

GitHub - xtdb/xtdb: An immutable SQL database for application development, time-travel reporting and data compliance. Developed by @juxt

An immutable SQL database for application development, time-travel reporting and data compliance. Developed by @juxt - xtdb/xtdb

GitHub

```clojure
(xt/execute-tx
node
[[:update '{:table :usage
:bind [{:xt/id id} user]
:unify [(from :usage [{:xt/id id} user-id])
(where (nil? user-id))]
:set {:user-id user
:guild-id "98393139101827072"}}]])
```

I wanted to copy user->user-id in records that lack a user-id. Am #xtdb ing correctly? Also filling in guild-id with a static value.

Took me a while to get this right!

Me finally deciding I should try #datomic, going all the way through helloworld only to realize that the "datomic local" flavor doesn’t do stored functions.

(╯°□°)╯︵ ┻━┻

So to even try those I'd have to spin up a local postgres, deploy datomic transactor, and figure the pg schema.

#xtdb looks like fun again.

I was sick for the last ~ 10 days. Done almost nothing. 🤒 Feeling kinda recovered today. 🙏 ☀️

But had some shorts moments of clarity to play with #xtdb (#clojure) https://xtdb.com

I saw it ~ year ago when it was v1. Then they've released v2 with some breaking changes.

Summary: cool idea, but still raw as f.
The last drop for me was: they have an option to add metadata to the transaction but it's hidden from the public api and the PR is there for ~ 2 years

Switching to #datomic

XTDB — immutable SQL database for data compliance

XTDB

Well, it looks like I'm building another database again.

This time, it is a database embedded into the MDM tool I'm working on, and it is heavily inspired by #Datomic and #xtdb

At some point (I missed the memo) #xtdb stopped espousing #datalog and invented #xtql. I'm guessing this was to step out of any annoying dependencies of datalog and dampen comparison with the other major datalog approaches in #Clojure.

https://docs.xtdb.com/intro/what-is-xtql.html I especially enjoy the side-by-side Clojure/JSON comparisons here
What is XTQL?

XTDB

#git must have been the first successful bitemporal database.

The commits trees are the domain time, and the reflog is the transactional time.

It must has been the inspiration to #datomic and #xtdb.

#git #datomic #xtdb #clojure #database

@aphyr Many thanks for this talk Kyle - lots of great pointers for our work on #XTDB 🙏

neat little thing I just thought up to test some side-effecting #clojure code that's using #xtdb:

```
(let [tx-submission (atom nil)]
(with-redefs [biff/submit-tx (fn [_ctx tx] (reset! tx-submission tx))]
```

Then I can inspect the state of what was submitted to see if it matches what I expect.