Pro-flatfile:
- No database required.
Con-flatfile:
- All the functionality has to be written by you.
- No proper locking. A flatfile can only be locked as a whole or not at all.
- No indexes, every query MUST do a sequential scan.
(selecting all records that have 'Bert' in them requires that you read ALL records and manually filter out the ones with 'Bert' in them)
- Zero scalability (because of the lack of indexes)
And finally the real pincher:
- You end up writing your own 'SQL' interface to a flatfile, and MySQL has already done that for you.
Pro MySQL:
- Indexes, records can be located without sequencial scans.
- Caching, results of queries remain in cache so the next time you do the same query you get the results immediately.
- SQL language support: you can talk to the database in a powerfull standardized language.
- Scalability, because MYSQL uses the SQL language, it's portable to other database servers.
And an important but often overlooked argument:
- The flatfile scooter may outrun the MySQL 747 on the quarter mile, but if a scooter is all you have, you'll never try to outrun the 747 on anything more than the quarter mile.
Why not?
Because after a quarter mile fullspeed on a scooter, your bum hurts like hell.
In other words, flatfile-based applications are usually very simple in their functionality because making the functionality more complex requires oodles of work to create functions that can process the flatfile data.
I'd like to see that pro-perl guy to a flatfile version of this:
SELECT table2.age,
max(table2.column1),
avg(table1.column3),
substr(max(table1.lastname),1,4)
FROM table1, table2
WHERE table1.id = table2.id
AND table2.age>100
AND table2.age<200
GROUP BY table2.age
HAVING count(table2.bool) > 5
ORDER BY table2.age ASC
LIMIT 10,5
I'm sure he can do it, but I wouldn't hold my breath.
Oh, allmost forgot:
Con-MySQL
- MySQL needs to be installed. Which can take up to 5 minutes, 10 minutes if you have no experience :-)
Conclusion:
MySQL is so completely light-weight and function-rich, that you'd have to be a total pr*ck to prefer doing everything by hand.