biff

2026-05-27T04:43:37.296869Z

I've got a rough draft of biff 2.0 here: https://github.com/jacobobryant/biff2 None of that code is ready to be depended on yet, but you can run the demo app locally and poke around at the code if you want. With that in place, I'm now going to start cleaning up and releasing the libs one by one.

👀 1
❤️ 1
🙌 2
🙌🏼 1
kpassapk 2026-05-27T15:43:03.559919Z

looking forward to looking through the code! That's how I learned Clojure: looking through the Biff codebase

🙌🏼 1
Martynas Maciulevičius 2026-05-27T16:42:50.902129Z

I was just looking at my old biff app that I no longer deploy and I saw that the master version still uses XTDB1 (can't say it's bad though). Will biff2 have xtdb2 or other DB? Currently I don't see any in the deps.edn: https://github.com/jacobobryant/biff2/blob/master/deps.edn I see hikariCP in this one, so probably no more xtdb? https://github.com/jacobobryant/biff2/blob/master/deps/deps.edn Update: saw the README. Probably XTDBv1 will be used.

2026-05-27T17:19:28.110659Z

@kyle948 that's awesome! let me know if you run into anything that looks weird. of course for any of the libs that aren't released yet/still have unedited AI-generated code, there probably will be plenty of weird stuff ha ha. @invertisment_clojuria the default will actually be sqlite (see https://biffweb.com/p/biff2/ for an explanation of that), and I'll also support/have a lib for XTDBv2. With biff 2 it should actually not be that hard to swap out the DB / have AI generate new "biff DB adapters", e.g. I was planning to possibly also make some adapters for other DBs like postgres, datalevin, https://github.com/xit-vcs/xitdb... and in fact it occurs to me just now that making a XTDB v1 adapter would probably be a really good idea, so existing biff apps could migrate to biff 2 without having to do a DB migration at the same time.

Martynas Maciulevičius 2026-05-27T17:57:14.445409Z

I'm thinking about writing something from scratch. So I don't expect any migration. I already tried to inspect things in biff2 and I saw that with sqlite I'd not have :on-tx like in XTDBv1 but that's probably fine.

2026-05-27T19:23:32.485449Z

nice, that makes things easy. And yeah, neither sqlite or xtdb v2 have a built-in/exposed transaction listener thing like xtdb v1 has. with xtdb v2 you can at least poll for the latest indexed tx ID. I have set up the sqlite adapter so it will call https://github.com/jacobobryant/biff2/blob/f08ac71bda364a757d9137f4d6a9a96df81dded6/libs/sqlite/src/com/biffweb/sqlite.clj#L242 whenever you submit a transaction via com.biffweb.sqlite/execute, so as long as you do all your writes that way, you can set the :biff.db/on-tx key in a biff module to get notified. e.g. the datastar module https://github.com/jacobobryant/biff2/blob/f08ac71bda364a757d9137f4d6a9a96df81dded6/libs/datastar/src/com/biffweb/datastar.clj#L249.

Martynas Maciulevičius 2026-05-28T13:47:20.807909Z

But I'm also thinking whether I want to make it a two-node app or no. I'm not sure yet.

2026-05-28T14:43:45.288469Z

If you do go for a two-node app/want to make it easy to start doing that at any point, any DBs in particular you lean toward? obviously there's xtdb2, or postgres, datomic... I see in #C06MAR553 that datalevin just released support for clusters too.

Martynas Maciulevičius 2026-05-28T15:44:47.682079Z

I'm thinking about making my own notify system in-app with sqlite and then migrating to postgres. But I'll want to keep it extremely low functionality to have less problems later. Yes SSE is what I want but I want to keep it light.

2026-05-29T03:40:17.024629Z

makes sense. probably would make sense for biff to have a postgres adapter anyway.

Martynas Maciulevičius 2026-06-03T16:11:15.629309Z

If you didn't need it it might be that most projects don't outlive xtdb/sqlite

2026-06-03T16:22:29.767979Z

eh. I'm planning to write some kind of specification / guide for writing new DB adapters, and then I'm hoping it won't be that hard to generate them. and IIRC there was in the past interest for using biff v1 with postgres; or at least I assume there was since I wrote a how-to guide for it.