datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
cmdrdats 2020-09-05T06:15:50.277900Z

@kaxaw75836 interesting point about the storage requirements, would be interesting to know if this is the case

cmdrdats 2020-09-05T06:17:51.278100Z

@favila thanks, that's useful - some great examples. I guess it's about whether that data should live in code or in database

v 2020-09-05T18:20:21.282600Z

I am working on an app where I am using d/with function to store intermediate transaction steps. I want to apply all the changes I made using d/with to actual database. How can that be achieved

val_waeselynck 2020-09-05T22:31:17.283500Z

I don't see any trivial way to do that. You could keep track of your transaction results, compacting the added datoms into one transaction of the same effect. Such a compaction is not straightforward, as the intermediary transactions might produce conflicting datoms, and new entities might have been created in the way. In addition, in the general case, you're facing a potential concurrecy issue here, because computing changes speculatively and submitting them later is not transactional. Between the moment you compute your changes locally, and the moment you transact them, another transaction might have occured, causing your changes to violate an invariant (for example, setting a banking account's balance to a wrong amount, effectively erasing the result of a transfer).

👍 1
val_waeselynck 2020-09-05T22:33:12.283800Z

My point here is that there's no way to make this foolproof without knowing more about the nature of your changes.

👍 1