[eluser]aidehua[/eluser]
I'm working on a CI website that will allow users to create a blog as part of their user account.
The basic database prototype is pretty straightforward. Let's say (to keep things simple) there is a table for blog_posts and a table for blog_comments.
The question is: would you create a new blog_posts and blog_comments table for each new user's blog?
e.g.
for user 1: blog_posts_1 and blog_comments_1
for user 37: blog_posts_37 and blog_comments_37
for user 38: blog_posts_38 and blog_comments_38
etc.
OR
would you put blog posts for ALL the users in the the SAME set of tables, and just store the user_id in the blog_posts table like this:
blog_posts
----------
id
user_id <-- Just use this field to identify which blog this post belongs to
title
content
date
blog_comments
-------------
id
post_id
comment
I'd be interested in your thoughts on the advantages / disadvantages of the two approaches, especially if you've actually implemented something like this before. Which route did you choose?