Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For 90% of the web devs that just spin up Postgres/MySQL, why would you use Datomic over that?



Just the temporal properties alone make it very useful for anything where it matters like billing, finance, inventory. Else you are in views/schema/indexing hell to do it on top of SQL.

There is some SQL temporal support but it's not great and varies a lot. Also since it's not native to the storage it has a lot of complexity issues under the rug making it not great.

Many financial systems use Event Sourcing (OOP + ORM). I had to suffer this at a previous employer.

See https://vvvvalvalval.github.io/posts/2018-11-12-datomic-even...


The temporal support seems handy, but time is still going to be really tricky for financial systems. Datomic only covers what the physical state of the database was at a particular time, but there's also the effective legal time (maybe a payment was dated a day before the system actually processed it) as well as requirements to remove data after a period of time (including point in time stuff).


There's a bitemporal Datomic-like database from JUXT that does exactly that, I believe https://www.xtdb.com


Indeed, it depends a lot on the domain. Datomic only has "technical" database time, and doesn't have any built-in way of modelling domain time. You can set the transaction timestamp manually when you write, but you can't set it to be earlier than the latest transaction that was committed. So, if you want your domain modelling to piggyback on Datomic time travelling, you can only do things like delaying writes for, say, an hour, and hope you have all the data by the time you commit to db.


> Just the temporal properties alone make it very useful for anything where it matters like billing, finance, inventory.

you can easily create datamodel to have this in SQL dbs: create table transaction_history(..., execution_time timestamp);


This is not an answer, it's the beginning of a question. Yes sure, we know `create table` and we know it's a good idea to record the execution timestamp. What exactly do you put in the place of the three dots?


Fyi, Datomic lets you look at the entire database at any point in time, as an immutable value. Also, you can annotate transactions with metadata, and query for "which tx wrote this specific value for this row/column" and look at custom metadata you added to the tx to reason about your system. Doing all of that in SQL is not trivial, to say the least.


You have to add a lot of scaffolding to postgres to make it semi-immutable. datomic just is, wanna know previous user email, just go back and see. Out of the box, without thinking about it.


Immutability is certainly tempting for certain kinds of data. Does it handle use-cases where data needs to be deleted though? i.e., privacy compliance.


It looks like they call that excision, which leaves behind a breadcrumb saying something was deleted and which can't itself be deleted.


Temporality in general becomes super handy if you have something like reports that need to be consistent across time. Or if you want to ask questions about the past. Or questions about the future without affecting the present.


Super interesting, thanks.


That's not easy to answer. It's a question of:

- mutable data vs immutable data

- tables, row based vs tripple store, attribute based (EAV/RDF)

- table schemas vs attribute schemas

- relational connections vs graph connections

- SQL vs datalog

- nested queries vs flat queries and rules

- remote access vs client side index

etc.


Because its a different model of integrating your database and your app.

It allows you to write queries in a pull style, it can be trigger based, datalog or raw index access. Its by default immutable and allows historical query. It allows meta data on the transaction themselves.

A lot of the time the user builds much of that himself or relays on frameworks to do it.


A tangent but it would be interesting to see survey data of how many devs default reach for SQL first these days. A lot of people use various other kinds of DB models which are preceived to have smoother learning curves.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: