I have a system where people would upload something, then a single link would identify the uploaded file and display for other users. Each file would have its own page and they will have a comment box. Now I have the general idea of how to create the PHP script and the SQL I just have one problem. What would be beter? storing up all of the comments for each file in a single row, and adding a delimiter for each new comment? Or creating a new row for each comment input but having the same reference to the file? I would prefer if each comment had its own row in the SQL but then it can easily grow up to thousands of entries per day and im not sure if that’s efficient.
Which approach from the two is the most efficient?
Adding a new row for each comment would make more sense. You could have a column in the comment table which would be FileID and easily filter the results by that. While you will have people commenting on it and that will add rows, it will be much more efficient than having a single row. Especially considering that you will likely not have enough space for thousands of comments in a single row!
If you’re really concerned about having too many comments, you should look into a NoSql solution like MongoDB or Cassandra. These systems are made specifically for handling large amounts of inserts (ie: new comments).