4 ms·
Anyone with experience has some detailed info about the limitation, trade-offs and problems of using Datalog instead of SQL? Datalog seems like a natural choic
by lukashrb 6y ago
Anyone with experience has some detailed info about the limitation, trade-offs and problems of using Datalog instead of SQL?
Datalog seems like a natural choice as declarative query language but has not yet become mainstream. I wonder why?
- lgessler 6y agoUsing Crux's Datalog query language from Clojure is great. Normally if your query building library is giving you a data-like interface, then you're relying on some abstraction that will inevitably leak in places (and let's not talk about ORMs), but since Crux really does natively use EDN (Clojure's data syntax, roughly analogous to JSON) for its query language, you've eliminated an entire layer of complexity in your application, and you also have the entire programming language at your disposal for compositionally building queries. That's not to say that using the SQL API is a bad idea, but if you're using Crux from Clojure, you'd be missing out on some stuff.
- jonahbenton 6y agoShort answer is that Datalog is originally a logic/proof language, while SQL is an arithmetic / statistical / tabular aggregation language. One can make one solve problems of the other but they're really different mental models, which impacts the representation of the data needed to enable their use. For Datalog one needs relationships- a graph- not what SQL calls relations, which is just data. Datalog requires a richer set of opinions- at least conceptually- about the data. Languages like Datalog will not become mainstream until graph modeling is mainstream.