My suggestion is that you only want to track what you like.
public class Page { public ObjectId Id { get; set; } public DateTimeOffset Date { get; set; } public string Name { get; set; } public int NumberOfLikes { get; set; } } public class Post { public ObjectId Id { get; set; } public ObjectId PageId { get; set; } public DateTimeOffset Date { get; set; } public string Message { get; set; } public int NumberOfLikes { get; set; } }
Then I would queue up the reaction (like or disliking) for insertion, "sentimental" information should not be stored in real time, right? This is not medicine, banking, etc.
public class Like { public ObjectId Id { get; set; } public ObjectId ParentId { get; set;} public ObjectId UserId { get; set; } public DateTimeOffset Date { get; set; } }
Where is the line? to the Likes collection. Why not become part of the page or post? Because if the message becomes viral (as you said, although most will not), you can get 1,000,000 people. Who will view this information other than analytical?
You must also ensure that the user can express his reaction only once per element.
source share