Is it better to store user text (such as a blog entry or private messages) in the database or as flat files?
- by Fredashay
I'm building a social networking type site that will be storing large chunks of text that's entered by users, such as blog entries and private messages. As such, these will be entered once, with minimal revisions, but many reads by multiple users over time. I'm using MySQL, by the way.
My concerns are:
Storing large blocks of text on the database will fill the database to capacity eventually.
I read somewhere that storing user text in flat files is a security risk? (The filenames will be generated dynamically by the PHP, not by the user.)
Storing them as text files may cause them to become out of sync if I ever have to reinitialize the database and restore it from backups.
What are all your thoughts and advice, pros and cons?