Storing blog posts and comments issue
Posted by: SBD --
Date: January 11, 2009 10:37AM

Hi all,

I have recently working on a new project - which is a private blog I want to develop, for personal use.

I encounter a small design issue, which I couldn't solve, I will be glade if someone here could help me out.

The problem is (like the title mention) the way to store posts and comment,
some suggest to me to keep on big table of "posts" which every post has a parent post and the root post will just have NULL there.
I didn't liked so much that solution, because there isn't any separation between post and comment, and if for example I would like to keep some extra information about posts which I don't need about comments it will be a waste of space.

So I though about different table, posts and comments while every comment will have a parent comment *and* a post connected to.
Though this way I'm saving information about comments which I don't interesting at - I don't need to know what the post of a sub-comments because it's parent-comment have the same post id - why would I save it twice then?!
So the next approach was to add another table comments_for_posts which will like root-comments to their posts. this way I don't save any double information,
But it seems a bit don't OK in the manner of that I can have some illegal information in this table - by mistake having a comment there which is not a root-comment or something alike.

Is there any standard way of doing this, so no space will be wasted and the data will save with minimal places for errors?

Thanks in advance for you help,
Shay.



Edited 1 time(s). Last edit at 01/11/2009 10:38AM by SBD --.

Options: ReplyQuote


Subject
Written By
Posted
Storing blog posts and comments issue
January 11, 2009 10:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.