3 ms·
There's a bit of a barrier to entry for Datomic because it really doesn't look quite like anything that you're familiar with if you're just used to SQL and NoSQ
by drostie 14y ago
There's a bit of a barrier to entry for Datomic because it really doesn't look quite like anything that you're familiar with if you're just used to SQL and NoSQL. The basic starting point is one big many-to-many relation, what in SQL might be one big table of (db_id, subject_id, verb_id, object_id, timestamp) of these "facts" which are (subject verb object) tuples, and these queries can be limited by the transaction timestamp. I'd say more about it but honestly, because it's closed-source, I've had real trouble figuring out what exactly is going on in the backend; a lot of the organization is done with namespaced keywords so I am not sure how exactly the datatypes are organized, but you can query based on subject, verb, or object quite rapidly. As Rich Hickey says, one instrumental thing is that these tuples are only inserted -- they are never updated or deleted. This enables a "many readers, one updater" architecture without violating consistency when you're updating the data: nobody uses a timestamp greater than their recorded one until the model (in the MVC sense) tells that view that it's ready to update. There is a mechanism for naming new elements in your transactions so that you can insert a bunch of facts at once.
It's also a little difficult because it is substantially meta -- instead of a special syntax ("CREATE TABLE" etc.) for handling structure, the information about how the database is organized is stored in the same "fact" tuples that make up the rest of the database, just with some automatic verbs that come bundled in. I'm always a fan of self-expressing systems, but that might throw some newcomers for a loop.
I guess my main comment about Datomic is, "I wish there were an open-source version out there." I'm interested in seeing what the plumbing of such a system looks like and perhaps learning something from it -- and I'd like to peek at their Datalog engine and so forth. Unfortunately, just from peeking inside the JAR, it appears that one might need a good understanding of Google Guava and Apache Ant and the Jetty server and a bunch of other things to be able to read the source, which might make it prohibitive to peek inside the code. I'm more interested in learning from the system than I am in using it.
- tom_b 14y agoI share your interest in the Datalog engine implementation. The free version of Datomic does include Datomic Datalog and you can certainly play with it against the normal Clojure data structures without bothering with the backend. You might be interested in Cascalog, which is a similar, datalog-style query engine designed for use on Hadoop. But it can be run locally with a play data space. The implementation is open source and you can peruse it nicely. fogus is working some on bacwn: https://github.com/fogus/bacwn https://github.com/fogus/bacwn which may also hold interest for you. Sooner or later I'm going to get back on the prolog-y, datalog-y chapter of ANSI Common Lisp as well.
- JPKab 14y agoThe description you have for datomic is pretty much spot on for how graph databases work, with schema and data both stored as data, subject verb object tuples, etc. It's sad that this is a new concept for so many people in the software industry, considering that graphs are one of the core data structures taught about in CS.
- kinleyd 14y agoLike most technologies, Datomic builds on ideas and concepts that already exist, and would find it hard to set itself apart by simply latching on to a single idea or concept. So if it were "just another" graph database and nothing more, I'd agree with you. However, Datomic puts together a whole host of other concepts - data immutability and all its resulting benefits; separation of query, storage, write, coordination (with carefully considered trade-offs); Datalog-based querying in place of SQL; in-app access to data with a great solution for the string concatenation hell that we've all gone through trying to juggle our SQL, and the list goes on. I don't think any of these individually make Datomic special, but collectively? IMHO, outstanding! Edit: For those interested, we have a new Datomic Community on G+ where we have collected a number of links to Datomic resources and videos: https://plus.google.com/communities/109115177403359845949 https://plus.google.com/communities/109115177403359845949