18 ms·
For 90% of the web devs that just spin up Postgres/MySQL, why would you use Datomic over that?
by mbesto 4y ago
For 90% of the web devs that just spin up Postgres/MySQL, why would you use Datomic over that?
- roguas 4y agoYou 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.
- evantbyrne 4y agoImmutability is certainly tempting for certain kinds of data. Does it handle use-cases where data needs to be deleted though? i.e., privacy compliance.
- mcbits 4y agoIt looks like they call that excision, which leaves behind a breadcrumb saying something was deleted and which can't itself be deleted.
- deleted 4y ago[deleted]
- dgb23 4y agoTemporality 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.
- mbesto 4y agoSuper interesting, thanks.
- fulafel 4y agoA 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.
- deleted 4y ago[deleted]
- alecco 4y agoJust 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-event-sourcing-without-the-hassle.html https://vvvvalvalval.github.io/posts/2018-11-12-datomic-even...
- slaymaker1907 4y agoThe 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).
- augustl 4y agoIndeed, 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.
- nlitened 4y agoThere's a bitemporal Datomic-like database from JUXT that does exactly that, I believe https://www.xtdb.com https://www.xtdb.com
- riku_iki 4y ago> 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);
- dgb23 4y agoThat'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.
- panick21_ 4y agoBecause 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.