Top
Best
New

Posted by tee-es-gee 6 days ago

What if database branching was easy?(xata.io)
70 points | 57 commentspage 2
efficax 3 days ago|
what if writing a blog post without ai was easy?
SOLAR_FIELDS 3 days ago||
Wouldn't it be great if Aurora Serverless V2 actually supported this copy-on-write semantic? I would immediately be able to throw out a pile of slow code if they did.
tee-es-gee 3 days ago||
Xata is open source btw (open core): https://github.com/xataio/xata
gulcin 3 days ago|
Came here to say this :) Anyone using Xata here?
dirtbag__dad 3 days ago||
Has anyone used this for debugging? Like an error in datadog triggers an agent sandbox and branched database?
theaniketmaurya 3 days ago||
i was using neon and they had some similar feature but now using planetscale. would be curious to know how you all are doing it?
tee-es-gee 3 days ago||
We have an overview on how it works here: https://xata.io/blog/open-source-postgres-branching-copy-on-...
miketery 3 days ago||
We used neon at last job. It seemed pretty cool. What made you switch to planetscale?
zwily 3 days ago||
Planetscale has better performance and uptime. But the branching keeps me going back to neon…

Yes planetscale can branch too, but it takes longer and you pay individually for each branch

gulcin 3 days ago||
Xata is open-source now, maybe you can give it a try as an alternative to Neon.
Nihilartikel 3 days ago||
This kind of magic is the reason that I'm very itchy to be able to line up real work on Datomic or XTDB someday.
xeubie 3 days ago|
Surprisingly, neither Datomic nor XTDB support branching. See: https://blog.danieljanus.pl/datomic-forking-the-past/

I actually built my own immutable database which does support branching (see profile), so it seems like a huge miss that these ones don't. It's pretty much the main reason I would want an immutable database.

nathell 3 days ago|||
It appears that Datahike [0] is a Datomic workalike that supports branching. I haven’t tried it out myself (yet), but the documentation suggests it’s possible [1].

That said, I’m adding xitdb to the list of tech to try out. Thank you for building it!

Oh, and thanks for linking to my article :-)

[0]: https://github.com/replikativ/datahike

[1]: https://datahike.io/notes/the-git-model-for-databases/

camdez 3 days ago|||
Wait, this statement seems way too strong.

The linked article points out that Datomic doesn't support branching from the past. It absolutely does support branching, and I've built entire test suites that way.

From a cursory glance, I'd say Datomic does exactly what the original parent article is discussing. It works great and it's super convenient.

xeubie 3 days ago||
If each "branch" is read only, it's not a branch at all. The entire idea of branching implies that you can make changes on one branch, then switch to another branch and make changes to it. They start from the same point and grow in different directions, as the metaphor of branches on a tree depicts.
camdez 3 days ago||
I don't disagree with anything you've said here, I just don't see how it applies to the situation.

With `datomic.api/with`, you can apply new datoms and get back a new DB value. Repeat this process as many times as you want, in as many directions as you want, switching as you choose. You're building a tree of immutable DB values—seems clearly like branching to me.

If by "read only" you mean that they're not persisted to disk, then that's an important point, but it surely doesn't obviate the utility of the functionality. It's useful in a number of cases, and especially testing scenarios like the Xata article describes.

If you built an immutable database that persists the branches, that is very cool and sounds useful—kudos! That said, I also don't want to downplay the utility of what Datomic does; it's a major help to me.

xeubie 3 days ago||
Yes the article I linked mentioned d/with (speculative writes), and you are right that it is useful for testing -- but not much else, since it is purely in-memory. If you want to call that in-memory branching that's fine, I'll concede that.

My database supports persisted branching, but not just at the database level. You can "branch" (i.e., make a fast clone) data at any level, such as data for a specific user. Many production uses for this, not just testing, yet almost no database supports this. It uses the same HAMT algorithm that Clojure uses.

sunny678 3 days ago||
feels like branching doesn't replace seeding, just complements it- seeds for speed, branches for realism.
pd_grahamt 3 days ago||
Branching is more or less instant if you’re keeping staging in sync with a nightly/weekly cron job
canarias_mate 3 days ago||
[dead]
throwaway81523 3 days ago|
I mean there's a whole book about this, "Purely Functional Data Structures" (2009) by Chris Okasaki.