Your option ( b ) is essentially idiomatic and the only way to enter data.
The entire digital circuit is encoded only as values ββthat an attribute can take in the value structure of an attribute-value-object (EAV).
See http://docs.datomic.com/schema.html for a key sentence taken from the docs:
Each Datomic database has a schema that describes a set of attributes that can be associated with objects. A schema defines only the characteristics of the attributes themselves. It does not determine which attributes can be associated with objects.
Entities themselves are very abstract (and internally are just numbers), all interesting properties of entities are encoded as attribute statements. Objects do not print! You create the semantics of the entity by the attributes that you approve for it, for example: user / firstname ,: post / title ,: post / content ,: topic / description, etc. That's why you really want a namespace to be assigned.
A particular case of this is the attribute type :db.type/ref , where the value of "V" in EAV is itself another object. This is what creates semantic associations between entities. You give each attribute a βnameβ (like :db/ident ) to capture what the connection E β E actually means. So you can have the attribute :db.type/ref with :db/ident ": post / author ".
Note that all attributes :db.type/ref are essentially bidirectional, therefore, if Eu is an entity representing a user, and Ep is an entity representing a message, then the following are equivalent in creating and querying dates:
[Ep :post/author Eu] [Eu :post/_author Ep]
All entity relationships, which are only more detailed attribute statements, are truly flexible. If you later want to add the concept of your favorite posts, this is just another attribute :db.type/ref . Create it with :db/ident , such as:: user / favorites, and approve the connections between existing users and messages (which have different user objects as authors).
[aUser :user/favorites somePost]
There is no concept of attributes associated with a collection, so what you offer in ( a ) is not properly expressed in datomic. You must use a query to aggregate messages. Removing mail will be simulated by retraction of the entity itself. Such an allotted post will remain visible in the history of the database.
This poses the problem of how to specify the order for entity lists. You need to either use the "natural" order, for example, the publication date (fixed either in the official transaction, or as an explicit attribute of the message), or use explicit ordering based on the attributes, for example, by means of: post / up - the numerical attribute of votes.
If you need a semantic grouping of objects where the "subsystems" are only meaningful and exist only as part of something larger - for example, position objects in an order - then see datomic components .