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:
username: John\npassword: e2fc714c4727ee9395f324cd2e7f331f\nemail: email@example.com
In other words, what are the advantages of MySQL over flatfiles?
MySQL offers indexes and joins (for execution performance), transactions (for data integrity) and
SQL (for development performance).
It your project involves just a
3-line self-sufficient text file, you don't need