Wasn’t there a plan to make persistence for DataScript? I don’t see it mentioned in this discussion: https://www.reddit.com/r/Clojure/comments/aa4aaf/taking_datahike_for_a_spin/ but it seems relevant
@niko963, isn't there a sense that https://github.com/comnik/clj-3df plus https://github.com/comnik/declarative-dataflow sitting on top of Kafka or datomic to persist things is like DataScript persisted?
@clashthebunny there is such a sense, at least for the read-side. On the write side the interesting thing is that Datomic transaction functions have transaction-time, ad-hoc access to the current database value. And if there is one thing that declarative-dataflow is not optimised for then that would be ad-hoc queries.
A solution is to express transaction functions as dataflows, e.g. [:db.fn/cas e a v v']
would be something akin to a join between ((e a) (v v'))
and ((e a) current-v)
followed by a semijoin between (v v')
and (current-v)
resulting in [e a v']
tuples.
While that sounds exciting (to me), I am sure it'll come with a number of interesting trade-offs and open questions.
Finally the mode of interaction will probably be different enough to be annoying to people who are just looking for an out-of-memory DataScript.
FWIW we're using a durable log + DataScript on the backend for a smaller-scale project and are very happy with it.