News for hackers. Stuff that matters.
Re:Biff tutorial: build a chat app with Clojure by charesjrdan on Wednesday November 23, 2022 @09:45PM (#33727308)
What’s the reasoning behind using some database I’ve never heard of vs Postgres etc?

Interesting project though

Re:Biff tutorial: build a chat app with Clojure by joeevans1000 on Wednesday November 23, 2022 @09:50PM (#33727332)
It's bitemporal and a graph database and so on. It seems like it can cover most of the use cases of a number of other dbs. This goes into that: https://docs.xtdb.com/concepts/what-is-xtdb/
Re:Biff tutorial: build a chat app with Clojure by jacobobryant on Thursday November 24, 2022 @05:02PM (#33736722)
The main ways that XTDB has been useful to me personally are:

- Immutability, which makes it fit well with the functional programming style used in Clojure. You can create a database connection object that represents a snapshot of the database at a specific point in time (usually the current time), and queries made via that object will ignore any transactions that occurred later. So you can effectively pass the entire DB around as an argument and your functions stay pure. (That also makes it easy to inspect historical snapshots, similar to looking through old git commits--I don't do it often, but it's very nice to have when you need it.)[1]

- Datalog instead of SQL. I find Datalog queries to often be more compact than the equivalent SQL, especially thanks to the implicit joins--you can query for things from multiple "tables" without having to type up a bunch of JOIN expressions. And there are various other handy doodads like pull expressions[2].

- Clojure ergonomics. You can store Clojure maps as XTDB documents as-is without needing to write code to translate them to records.

[1] XTDB's bitemporality also has some benefits over e.g. Datomic (https://www.datomic.com/, another immutable, Clojurey database), though I haven't needed to use it yet--Datomic's "monotemporality" would be sufficient for my current needs.

[2] https://docs.xtdb.com/language-reference/datalog-queries/#pu...

Re:Biff tutorial: build a chat app with Clojure by fulafel on Friday November 25, 2022 @09:01AM (#33742434)
SQL for XTDB seems to be under way in the XTDB "Core2" dev work, hope they keep Datalog too.