MongoDB / Mongoose Schema for Threaded Messages (Efficiently) MongoDB / Mongoose Schema for Threaded Messages (Efficiently) mongoose mongoose

MongoDB / Mongoose Schema for Threaded Messages (Efficiently)


On this particular topic you are in luck, there is a great post discussing the various approaches to the schema here (it's a slight twist on what you are looking at, but not much different):

http://blog.mongodb.org/post/65612078649/schema-design-for-social-inboxes-in-mongodb

Then, this topic was also covered in detail at MongoDB World 2014 in three parts by Darren Wood and Asya Kamsky:

Part 1 Outline and Video

Part 2 Outline and Video

Part 3 Outline and Video

Also at MongoDB World the guys at Dropbox talked about the lessons they learned when building their Mailbox:

http://www.mongodb.com/presentations/mongodb-mailbox

And then, to round it off, there is a full reference architecture with code called Socialite on Github written by the aforementioned Darren Wood:

https://github.com/10gen-labs/socialite