I'm very new to NoSQL and I'm trying to wrap my head around it. As an example I am trying to design a schema for a simple blog that has authors who have posts, which have comments. Like so:
Author
name : String,
email : String,
posts : [Post]
Post
title : String,
body : String,
comments : [Comment]
Comment
commenter : String,
comment : String
So this seems to be the most de-normalized way to design the schema. It works great when I want to get a list of an authors posts, but I run into problems when I try to query a post by it's title. This returns the author object and all that author's posts. I can then search the posts for the one I want, but that seems inefficient.
What is the most efficient way to handle this kind of schema? Should I only have a Posts object and make the author a field (or embedded doc) in the Post object? Or perhaps it's best to store the data in multiple locations?
I've spent so many years trying to normalize relational databases that I can't seem to think in the NoSQL way. Any advice would be appreciated.