[python, mysql, web] one big file OR many small files
Posted: Tue Dec 25, 2012 1:55 am
I'm in a strange situation where a server admin of a friend won't allow us to use the mysql python library, claiming it's a security risk. So while he's shopping for a new webhost I was thinking of a temporary work-around.
Currently we're saving user posts/comments to text files. But after some thinking I realized that I could just as easily save one post per file. This would eliminate the problem of accidently overwriting another users comment. It might even save space, compared to using a single big text file, since only comment data will be put into the text file. Note that the post ID would now be the file name and the timestamp might just be drawn from when the file was created.
I think that using multiple files will work better than a single file and plan to make the modifications this week. So far, I can't think of any draw-backs I could have, but I'm guessing there might be some obvious things I'm missing. Please feel free to point out why this is a bad idea.
Currently we're saving user posts/comments to text files. But after some thinking I realized that I could just as easily save one post per file. This would eliminate the problem of accidently overwriting another users comment. It might even save space, compared to using a single big text file, since only comment data will be put into the text file. Note that the post ID would now be the file name and the timestamp might just be drawn from when the file was created.
I think that using multiple files will work better than a single file and plan to make the modifications this week. So far, I can't think of any draw-backs I could have, but I'm guessing there might be some obvious things I'm missing. Please feel free to point out why this is a bad idea.