When should you use Datomic?

I am intrigued by the Datomic database service, but I'm not sure if it fits the needs of the projects I'm working on. When is Datomic a good choice, and when should it be avoided?

+48
database clojure database-design datomic
Jan 20 '14 at 22:34
source share
4 answers

Provided that I did not use Datomic in production, I thought I would give you an answer.

Benefits

  • Datalog queries are powerful (more than non-recursive SQL) and very expressive.
  • Queries can be written using Clojure data structures, and this is NOT a weak DSL, like many SQL libraries that allow you to query data structures.
  • This is immutable, so you get the benefits that immutability gives you in Clojure / in other languages ​​a. It also allows you to store, while maintaining structures, all past facts in your database - it is VERY useful for auditing and more

disadvantages

  • This can be slow because the Datalog will only be slower than the equivalent SQL (provided that an equivalent SQL statement can be written).
  • If you write LOT, you may need to worry about one transactor being overloaded. In most cases, this is unlikely, but think about something (you can make some kind of splinter, but you can save yourself, but this is not a database for storing stock data).
  • It’s a little difficult to get up and work with it, and it’s expensive, and the license and price make it difficult to use the hosted instance with it: you need to deal with sysadminning by yourself, instead of using something like Postgres on Heroku or Mongo at MongoHQ

I am sure that I am lacking some on each side, and although I have 3 of the disadvantages listed, I think that the advantages outweigh them in more cases where the disadvantages do not exclude its use. The price is probably the one that will prevent its use in most small projects (which you expect to overcome 1 year of free trial).

Cf. This is a short post describing Datomic just for more information.

Expressiveness (cf Datalog) and immutability are amazing. It's so much fun to work with Dataomic in this regard, and you can say that it is powerful just by using it a bit.

+31
Jan 21 '14 at 6:55
source share

One important thing, considering that Datomic is suitable for your application, is to think about the form of data that you are going to store and query, because Datomic data is actually very similar to RDF triples (the concept of the concept of first class), it fits very well for modeling complex relationships (related graph data) - something that is often cumbersome with traditional SQL databases. I found this aspect one of the most attractive and important for me, it worked very well, even if it is, of course, not something exceptional for Datomic, since there are many other high-quality offers for graphical databases, we need to mention Neo4J when we We are talking about solutions based on the JVM.
As for the Datomic scheme, I think this is the right balance between flexibility and stability.

+14
Jan 21 '14 at 9:46
source share

To complete the above answers, I would like to emphasize that immutability and the ability to remember the past are not “magical traits” suitable for several special cases, such as auditing. This is an approach that has several profound advantages over variable cell databases (which make up 99% of databases today). Stuart Halloway demonstrates this in this video: Impedance resistance is our fault .

In my personal opinion, this approach is fundamentally more reasonable conceptually. Having used it for several months, I don’t see Datomic have crazy magical complex abilities, but rather a more natural paradigm without any serious problems that others are facing.

Here are some of the features of Datomic that I find valuable, most of which are included in immutability:

  • because reading is not remote, you do not need to create your own requests, such as an expedition by wire. In particular, you can divide the problems into several queries (for example, find the entities that are the input of my query, - answer a business question about these entities - get related data to represent the result)
  • The scheme is very flexible without sacrificing the power of the request.
  • conveniently integrate your requests into the application programming language.
  • Entity API provides you good ORM parts
  • the query language is programmable and has primitives for abstraction and reuse (rules, predicates, database functions)
  • productivity: authors only interfere with other writers and no one bothers readers. Also a lot of caching.
  • ... and yes, several superpowers, such as a journey into the past, speculative recordings or ramified reality.

Regarding when not to use Datomic, here are the current limitations and limitations that I see:

  • you must be on the JVM (there is also a REST API, but you lose most of the benefits of IMO)
  • not suitable for recording scales, as well as for huge amounts of data
  • will not be particularly integrated into the framework, for example, you will not currently find a library that generates CRUD REST endpoints from a Datomic schema
  • this is a commercial database
  • Since reading occurs during the application process ("Peer"), you must make sure that Peer has enough memory to store all the data needed to pass through the request.

Thus, my very vague and informal answer would be that Datomic is suitable for most non-trivial applications that have written the load reasonably, and you have no problems with the license for the JVM as well.

As an analogy, you can ask yourself the same question for Git compared to other version control systems that are not based on immutability.

+7
Feb 02 '16 at
source share

Just to pre-add other answers:

It is probably fair to say that datomic represents the best conceptual framework for the requested data warehouse of all the other current options, being partially scalable and not exclusively efficient.

I say only partially scalable because requests must fit into peer RAM or fail. And not exclusively impressive, because first-class SQL engines can optimize queries to fit into memory using complex execution plans, which I have not yet seen as a function in datomic; Datomic transaction and query decoupling can in general offset this function.

Unlike many NoSQL engines, transactions are first-class citizens, which puts it on par with RDBMS systems in this key respect.

For applications where data is read more than written, transactions are required, requests that always fit into memory or memory are very cheap, and the total size of the accumulated data is not too large , this may be a victory in which a commercial product can be provided - for those who is ready to embrace their new conceptual framework implied in the API.

+2
Jul 21 '17 at 21:52
source share



All Articles