datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
2020-08-29T01:54:51.110200Z

Datomic seems the ideal system to reference entities at a particular point in time (ie the order was sent to the customer address as it was on Saturday 29th). I haven't seen a way of doing this in a way that feels natural - I could use the order time to get a database as of that point in time and read the address of course. Anyone discovered a better way?

seancorfield 2020-08-29T02:28:49.113100Z

@p14n I thought Datomic had a specific API for viewing the database as of a given timestamp?

2020-08-29T07:40:38.114500Z

It does, but not a way I know of to store that fact 'this reference is of time T'

pithyless 2020-08-29T10:37:28.115100Z

@p14n I think what you're asking for is what bitemporal databases (e.g. https://github.com/juxt/crux) are designed to model explicitly: differentiating between when information is recorded vs when that information is considered valid. The Datomic API only really concerns itself with the former (when information is actually recorded). If you want the latter, you can either model it using the same API (but then, e.g. you can't go back and easily change when something should be considered valid, since you can't change the time of recording); or you model it as additional valid-time attributes and make sure all your time sensitive queries take them into account. Valentin had a good blog post about this: https://vvvvalvalval.github.io/posts/2017-07-08-Datomic-this-is-not-the-history-youre-looking-for.html

2020-08-30T23:57:19.136Z

what are we defining as valid? when i see some information is a straight forward idea, i don't have a strong understanding of what valid means in this context?

2020-08-31T01:00:44.139900Z

So as-of doesn't give all attached facts past the given time? It gives just what was true as of that time.

2020-08-29T10:59:28.115700Z

Ah, yes, I think you're right

2020-08-29T10:59:34.115900Z

Thanks

Joe Lane 2020-08-29T20:15:35.119400Z

@p14n Isn't this just an attribute on an entity?

Joe Lane 2020-08-30T11:10:29.121300Z

I don't understand the problem you're trying to solve here but am interested in hearing more.