6 ms·
I know datomic is kind of like a logic based db right? Any example of the typical use case over a traditional relational db?
by throwaway7645 9y ago
I know datomic is kind of like a logic based db right? Any example of the typical use case over a traditional relational db?
- ThrustVectoring 9y agoI'm more of a fan of Datomic's query language than SQL's. It's much easier to parameterize, you can manipulate it as a data structure rather than a raw string, and you can easily ask questions about what the database knew at a specific time. The "as-of" function lets you get the value of the database at a specific time, and the queries you are already writing anyways are against the current value of the database, so it's easy to compare the two.
- throwaway7645 9y agoY do you care what the DB knew at a specific time?
- ertucetin 9y agoLet's say you are creating Git like system so you will need some data at specific time right?
- sbov 9y agoIt's useful in some scenarios, but I think the biggest benefit is debugging (something weird happened in prod? what was the database state?). I think people try to stretch its usefulness to scenarios where it doesn't quite fit. It almost fits for historical reports, but from my experience, usually you're going to find an error in your data that you want to fix "in the past" so those old reports change, and all of a sudden datomic doesn't automagically work for your historical reports anymore.
- throwaway7645 9y agoThat's interesting (debugging).
- fazzone 9y agoTo expand on the debugging bit, Datomic knows and can tell you the exact transaction responsible for every piece of data in the database. You can also see the complete state of the DB as of any transaction, but the complete history is more useful. It's like git blame for the database.
- ThrustVectoring 9y agoIt means that when you figure out how to calculate business metrics based off of information stored in Datomic, you get to compare how your business was doing versus how it's doing now for free. Or if you figure out a customer health score, it's now trivially easy to calculate how much it changed since last month.
- slowmovintarget 9y agoIt also means, if you're logging well, that you can replay the exact series of interactions, transactions included, that led to an end-user application failure. Untangled (ClojureScript on React) + Clojure / Datomic on the back-end.
- throwaway7645 9y agoNow that is neat!
- dragandj 9y agoAuditing, which might even be a legal requirement in some application domains.
- throwaway7645 9y agoI have audit tables in my relational database though...but its auditing is better?
- reilly3000 9y agoAll you have to do is call As-of in any expression to get a value relative to time, as the entire history of a named entity is stored efficiently with persistent data structures. It’s automatic, efficient, gives you the ability to query future values!
- always_good 9y agoI used it to show the edit history of forum posts until I found out the hard way that you're not to store long strings in Datomic.
- stonemetal 9y agoTheir query language is based on Datalog (a non Turing complete subset of prolog.) I can't think of a job where I would pick it over a SQL database. Maybe if you were already using Clojure, since there would be less impedance mismatch.