| 3. Data Schema

So I want to have comment threads that store, duh, comments from different users. Comment threads are obviously sequential/chronological as well as branching in a nested manner due to nested replies.

Comment threads are saved per topic so each topic will be its own separate document.

The parent comment thread container provides information such as:

- topic
- current number of comments
- date created
- sort option
- number of faves

A comment contains:

- an author
- a post date
- number of likes
- the actual comment content (body)
- child comments

Users like to be able to search and view all past comments. These will be organized according to the topic they were left under. These past comments can grouped in a single document? No, because over time the document will become very large and any time a new comment is made that entire document must be pulled out of the database, sent over the wire, updated and then sent back over the wire. So like a comment thread there will be a separate document for each topic that groups user's own comments on that topic. Though this does require two PUT requests for every new comment added; it allows users to store their own comments in their own database separate from the comment thread owned by another user.

That takes care of all the main data structuring, onward to overall application architecture.