As we all know, Datomic’s
cardinality/many relationships are sets. To enforce a sequential order on a
many attribute, one must manually implement a linked list or a position attribute, or serialize the list and store that.
(Aside: First-class ordered lists are a feature request from 2012, per Stuart Halloway:
The top-level decision with lists is “Do you want to query inside them?” If the answer is yes, then you should model a linked list or a positional list in Datomic. If you do not need to query inside lists, then you should request that we add support for lists as a first-class type. (We are already considering this.)
How are folks finding each of these options? Are there some that feel particularly elegant or clunky in your use case? I’ve been tracking position in other attributes and I feel rather ambivalent about manually tracking it.