Fork me on GitHub
#datomic
<
2020-06-26
>
David Pham07:06:23

Hello everyone :) in datomic, in the schema, how can you write that a combination of two keys is unique, like id and timestamp? With a tuple?

David Pham07:06:40

Does anyone have some suggestion how to implement an entity containing several timeseries? Or how to model time series?

marshall12:06:05

The modeling decision here is somewhat up to you, but one option is that each entry in the time series is an individual entity with an ordinal (or time) attr and your "parent" entity has a cardinality many reference to the set of them.

marshall12:06:54

If the set of time series entries is always small (<= eight) you could use a tuple

marshall12:06:30

If you never want to introspect the individual entries but will only consume the whole timeseries all together you could also store that data elsewhere in a LOB (like s3) and just store a reference to it in datomic

David Pham20:06:51

Thanks a lot!

David Pham07:06:21

I am sorry if it sounds trivial, but I am starting with data script.