{ ID => $_, name => "person_$_", address => "$_ Any St.", city => "Anytown", state => "AnyPlace", zip => $num } #### Benchmark: timing 500 iterations of CSV_Insert, Flatfile_Insert, Mysql_Insert... CSV_Insert: 12 wallclock secs (11.30 usr + 0.16 sys = 11.46 CPU) @ 43.63/s (n=500) Flatfile_Insert: 1 wallclock secs ( 1.00 usr + 0.10 sys = 1.10 CPU) @ 454.55/s (n=500) Mysql_Insert: 59 wallclock secs (31.21 usr + 3.42 sys = 34.63 CPU) @ 14.44/s (n=500) #### Benchmark: timing 500 iterations of CSV_Select, Flatfile_Select, Mysql_Select... CSV_Select: 7329 wallclock secs (7260.21 usr + 27.88 sys = 7288.09 CPU) @ 0.07/s (n=500) Flatfile_Select: 14 wallclock secs (10.54 usr + 3.84 sys = 14.38 CPU) @ 34.77/s (n=500) Mysql_Select: 143 wallclock secs (35.87 usr + 6.15 sys = 42.02 CPU) @ 11.90/s (n=500) #### Benchmark: timing 500 iterations of CSV_Update, Flatfile_Update, Mysql_Update... CSV_Update: 17312 wallclock secs (16920.40 usr + 135.93 sys = 17056.33 CPU) @ 0.03/s (n=500) Flatfile_Update: 244 wallclock secs (207.73 usr + 31.91 sys = 239.64 CPU) @ 2.09/s (n=500) Mysql_Update: 263 wallclock secs ( 8.27 usr + 2.63 sys = 10.90 CPU) @ 45.87/s (n=500) #### Benchmark: timing 1 iterations of CSV_Delete, Flatfile_Delete, Mysql_Delete... CSV_Delete: 16 wallclock secs (14.91 usr + 0.30 sys = 15.21 CPU) @ 0.07/s (n=1) (warning: too few iterations for a reliable count) Flatfile_Delete: 0 wallclock secs ( 0.18 usr + 0.04 sys = 0.22 CPU) @ 4.55/s (n=1) (warning: too few iterations for a reliable count) Mysql_Delete: 1 wallclock secs ( 0.01 usr + 0.02 sys = 0.03 CPU) @ 33.33/s (n=1) (warning: too few iterations for a reliable count) #### MySQL is not a flat file, it is a relational database. It is good at things that relational databases do well, such as retrieving related rows from multiple tables at once. Flat files are not relational databases. They are good at things such as writing data sequentially to the end of a table or retrieving data with ad-hoc structure. Don't use flat files when you need a relational database; you'll spend endless time implementing things that you can have for free by using the right data manager. Similarly, avoid making your relational database stand in for a simple flat file unless you will need relational capabilities on the data stored in the file later.