Hey Asya,
Thanks for the reply, makes total sense. I'll stick to the fan-out on write approach for Likes.
As for Fan-Out story inserts, do you have a recommended approach for breaking down the operation in background worker tasks?
As a side note, I handle duplication by having a Likes collection that keeps track of users who liked a story. It also allows me to display who liked the Story. The Likes Schema looks like this:
var likesSchema = new mongoose.Schema({
sid : {type : mongoose.Schema.ObjectId}, // (story for which these likes belong to)
seq : Number, // bucket #
likes : [ {
_id : { type : mongoose.Schema.ObjectId},
uname : String,
d : Boolean
} ]
});
Thanks!
Henri