Skip to content

Datomic For The 96 Percent

Stuart Halloway edited this page Jul 31, 2013 · 6 revisions

Motivation

Traditional SQL databases have great power, via ACID transactions and via a declarative, logic-based query language (SQL). But SQL databases encounter two problems on the web:

  • SQL databases have a rigid information model, and typically a rigid deployment model. This rigidity creates impedance mismatches both with development languages and with emerging cloud strategies.

  • SQL databases struggle with the extremely high write volumes that characterize the top four percent of the web, e.g. the Amazons, Facebooks, etc.

Much of the effort of the NoSQL movement has gone to solve the second problem, the problem of the four percent, under the mantra "web scale". Datomic solves the first problem -- with a flexible information model and a deployment model suited to the dynamic web, and to the cloud.

Datomic is for the ninety-six percent.

What We Will Cover

Datomic's information model is based on a universal relation, and an entity abstraction over that relation. The universal relation eliminates the join keys and join tables imposed by SQL's plethora of specific relations, making queries easier to write, read, and understand. Entities expose the universal relation as associative collections, which correspond directly to the navigable, associative style of OO, eliminating the impedance mismatch and the need for libraries such as ActiveRecord and Hibernate.

Datomic's deployment model is designed for a virtualized world. All components of the system are designed from the ground up to be ephemeral. More importantly, Datomic treats storage as a separate service. You can store your data on the local filesystem during development, and upgrade to using a SQL database for storage for production. When you are ready for the cloud, you can store your data in a distributed storage such as Amazon's DynamoDB, CouchBase, or Riak.

Datomic's flexibility comes with the expressive power you know and love in SQL databases. Where the four percent need "web scale", and the complex programming model imposed by eventual consistency, most programs would be better off with the traditional values: ACID transactions and powerful queries. Datomic gives you these in spades: transactions always run at the highest isolation level (serialized), and the Datalog query language has greater expressive power than the relational algebra at the foundation of SQL.

If you are among the ninety-six percent, and manage transactional data of record on the web, Datomic may be a good fit for you.

Clone this wiki locally