I am trying to figure out how you design data storage in a document storage system like CouchDB or MongoDB.
I don't use JOIN's anymore in my queries and just stick to searches for rows with certain indexes that meet my criterion. For example, I might look for recent comments (ORDER BY date
) or all active users (WHERE status = 1
). In other words, my search logic is all based on indexed int columns stored in RAM.
Moving over to NoSQL, There don't seem to be any indexes - so I'm trying to figure out these databases filter results without looking through each row manually. Update: somehow I missed this: http://vivu.tv/portal/archive.jsp?flow=783-586-4282&id=1270584002677
As for design, using the examples of storing a post with all comments as one document doesn't seem like it's logically sound. How would you find recent comments? Or how would you find the comments of a certain user?
Where can I go to learn how to convert schema's (and my way of thinking) so that I can build out apps using these document databases?
Update: I just didn't spend enough time going through the MongoDB site I guess. The documentation seems to cover most of the things needed like using indexes to filter results just like in sql. Also http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart and http://rickosborne.org/download/SQL-to-MongoDB.pdf were just what I needed.