Datomic is a terrific database and I highly recommend it. It has many functions that distinguish it from other database systems:
- Like Clojure's data structures, it is persistent, which means that by default adding new facts to the database does not remove old facts, which allows you to query the state of the database at a previous point in time, extends the audit capabilities and helps in debugging.,
- The basic Entity Attribute Value (EAV / triple) data model (at least partially inspired by RDF and the semantic network) is extremely flexible, allowing you to express arbitrary graph structures and easily deal with polymorphism.
- The query language is a kind of Datalog, a kind of query language based on pattern matching, which is strictly more expressive than SQL, and the like in that it can perform recursive queries, which makes it especially suitable for working with graphic data / queries.
- In addition to the Datalog queries, there are
pull
api that allow you to retrieve data from the database more simply using GraphQL as an expression that defines the shape of the document, the structure you want to pull from the database. These queries can even be used from a sentence :find
a Datalog query. - You can use the Clojure functions from your queries.
- The indexing system is very smart and more or less automatic, which contrasts sharply with the work usually done to tune the performance of SQL databases.
- Transactions pass through an API / function call other than requests, which means that the number one security risk identified by OWASP (SQL injection) is literally impossible in Datomic.
- The Transactor / read-replica design makes it easy to scale read / query operations while maintaining pressure on Transactor.
- This is damn fun.
One of the things you should pay attention to is that by using the EAV data model and data queries / data queries, Datomic gets structural flexibility closer to the NoSQL database flexibility, while remaining fundamentally relational and even more expressive in their relational queries. than SQL.
This is amazing, and you should definitely give him a chance. It will melt your brain a little. In a good way.
It is also worth noting that its popularity was inspired by a number of successful open source projects, so the main approach will not go anywhere in the near future:
- DataScript: partial in-memory implementation of clj / cljs
- Datahike: A fork of DataScript that requests disk indexes, which means you don't need to store everything in memory for the request
- Mentat: Mozilla project is trying to make Datomic-like for Mozilla project
source share