Hacker News new | ask | show | jobs
by Royalaid 2473 days ago
While it isn't the same https://juxt.pro/crux/docs/index.html is a good compromise in the space and is open source albeit a very freshly released project. One of the major blockers I had to adoption, needing Kafka, is no longer an issue with the release of https://github.com/juxt/crux/tree/master/crux-jdbc. A great starting point if anyone wants to check Crux out at a distance is https://nextjournal.com/crux-tutorial, starting https://nextjournal.com/crux-tutorial/start
1 comments

Could you say anything more at all about how Crux is a compromise compared to Datomic?

It seems to have a lot of what the latter has, as well as some features that it doesn't (e.g. it's bitemporal).

(I'm reading https://juxt.pro/crux/docs/faq.html but if there's anything you've seen that'd be super helpful)

The biggest thing I have noticed, granted I don't have a ton experience with either system, is point 1 outlined in the "Other Differences" section.

>Datomic’s datom model provides a very granular and comprehensive interface for expressing novelty through the assertion and retraction of facts. Crux instead uses documents (i.e. schemaless EDN maps) which are atomically ingested and processed as groups of facts that correspond to top-level fields with each document. This design choice simplifies bitemporal indexing (i.e. the use of valid time + transaction time coordinates) whilst satisfying typical requirements and improving the ergonomics of integration with other document-oriented systems. Additionally, the ordering of fields using the same key in a document is naturally preserved and can be readily retrieved, whereas Datomic requires explicit modelling of order for cardinality-many attributes. The main downside of Crux’s document model is that re-transacting entire documents to update a single field can be considered inefficient, but this could be mitigated using lower-level compression techniques and content-addressable storage. Retractions in Crux are implicit and deleted documents are simply replaced with empty documents

So what this means in pratice is that in Datomic you don't really "have" an entity/document (this isn't entirely true but feel free to dig into the details https://docs.datomic.com/on-prem/entities.html) but rather a set of facts (rows/tuples) at any given time, or across time, generally gathered up under one id. You can query on one of those facts and get exactly that back, one or more specific facts. Crux has this ability to query parts/attributes of a document but in terms of updating its all or nothing. There are other, more niche, considerations. One example I can can cite is looking at an entity through time in Datomic can be alien at first whereas with Crux its just a document, but overall this is the biggest thing I have noticed.

Oh and Datomic is pretty well battle tested and has the full support of Cognitect behind it whereas Crux is a newer OSS product by Juxt. That is both a pro and con for both camps, just depends on your needs.