Here’s a quote from
Rationale and semantics
Mocked connections use Datomic’s speculative writes (db.with()) and Clojure’s managed references to emulate a Datomic connection locally.
The main benefit is the ability to ‘fork’ Datomic connections. More precisely, if conn1 is forked from conn2:
- at the time of forking, conn1 and conn2 hold the same database value;
- subsequent writes to conn1 will leave conn2 unaffected
- subsequent writes to conn2 will leave conn1 unaffected
Let’s say you work on a problem and, as usual, you have several implementation ideas (aka Plan A, B, C…) and unpredictable implementational “I believe I did, Bob” moments.
So you start with Plan A (and try at the same time to cover common parts with other Plans, if any) and push until you stuck at some point. You switch to Plan B, just to find out that the key technology has unacceptable pricing model. So you switch to Plan C. Somewhere in the middle of Plan C you somehow find a solution for Plan A problem point and switch back to Plan A. And finish you task with Plan A.
During these back-and-forth motions, you’ve found a very useful tool (during Plan C), and have changed key element of Plan A, based on Plan B experience.
Back to Datomic.
What is(are) a good way to store these pivotal points (datomic forks/mocks) in Datomic?
It looks like “All values are equal, but some values are more equal than others”.
The very first version of this question: how to store datomic.db.Db@b1dbbe41
in Datomic?