News for hackers. Stuff that matters.
Re:Datomic Is Now Free by brundolf on Thursday April 27, 2023 @01:38PM (#35731746)
Something I've been curious about: how well (or badly) would it scale to do something similar on a normal relational DB (say, Postgres)?

You could have one or more append-only tables that store events/transactions/whatever you want to call them, and then materialized-views (or whatever) which gather that history into a "current state" of "entities", as needed

If eventual-consistency is acceptable, it seems like you could aggressively cache and/or distribute reads. Maybe you could even do clever stuff like recomputing state only from the last event you had, instead of from scratch every time

How bad of an idea is this?

Re:Datomic Is Now Free by augustl on Thursday April 27, 2023 @01:47PM (#35731887)
Datomic already sort of does this :) You configure a storage backend (Datomic does not write to disk directly) which can be dynamodb, riak, or any JDBC database including postgres. You won't get readable data in PG though, as Datomic stores opaque compressed chunks in a key/value structure. The chunks are adressable via the small handful of built-in indexes that Datomic provides for querying, and the indexes are covering, i.e. data is duplicated for each index.
Re:Datomic Is Now Free by brundolf on Thursday April 27, 2023 @01:58PM (#35732087)
Interesting! I assumed Datomic was entirely custom

Now I'm even more curious if you could skip Datomic and just do something like this directly with a relational DB in production

Re:Datomic Is Now Free by kamma4434 on Thursday April 27, 2023 @03:21PM (#35733250)
Yes, but you end up rewriting Datomic!
Re:Datomic Is Now Free by brundolf on Thursday April 27, 2023 @04:09PM (#35733875)
Well, except it sounds like Datomic is closed-source :)
Re:Datomic Is Now Free by Moru on Friday April 28, 2023 @02:51AM (#35738281)
Nah, our (not very good) implementation existed 10 years before Datomic :-)
Re:Datomic Is Now Free by JBiserkov on Thursday April 27, 2023 @04:11PM (#35733901)
But why?! The whole point of Datomic is that it implements this entire immutable framework for you, on top of mutable storage.

So YOU can focus on building your own specific business logic, instead of re-implementing the immutable DB wheel.

Re:Datomic Is Now Free by xmcqdpt2 on Friday April 28, 2023 @08:19AM (#35740401)
Because, for example, your application is not tied to the JVM? You are uncomfortable using closed source software for such a critical piece of infra? As far as I can tell they don't even have a searchable bug report database! I'd hate to be the one debugging an issue involving datomic.
Re:Datomic Is Now Free by koreth1 on Thursday April 27, 2023 @06:00PM (#35735127)
That's a pretty common pattern in event-sourcing architectures. It is a completely viable way to do things as long as "eventual-consistency is acceptable" is actually true.