A friend and I were debating about whether he should use MySQL or a flatfile database for his website's backend. I told him to go with MySQL because it was structured, held records well, and was consistent. He on the other hand said that he would rather go for speed. Reading files is a lot quicker than connecting to MySQL and it made me wonder whether he was right. For example, why not just create a folder for each table, like so: users/
groups/
posts/
, within the folders have the files named by ID (1
, 2
, 3
) and then for the data use a format like so: username: John\npassword: e2fc714c4727ee9395f324cd2e7f331f\nemail: [email protected]
?
In other words, what are the advantages of MySQL over flatfiles?