Currently we're holding actions in a separate collection with a reference to the action either in comment or user. The fact is that an action is tightly coupled with a specific entity and it also doesn't change over time. There are several advantages to keeping this denormalized (flat) within the parent entity.
No additional work is needed in stats/aggregation.
Can be organized by the type of action making it easier to read.
The current complicated action model becomes much more simpler.
Currently we're holding
actions
in a separate collection with a reference to theaction
either incomment
oruser
. The fact is that anaction
is tightly coupled with a specific entity and it also doesn't change over time. There are several advantages to keeping this denormalized (flat) within the parent entity.