MongoDB vs. MySQL (MyISAM and InnoDB) – performance comparison

As part of learning new tools for testing, I took the mongoDB database performance and comparing the results of a MySQL database, both in MyISAM and innoDB tables.

As a test platform, I used only the local computer with 4 GB of RAM, i3 (2.4 GHz). The data source was a table of 217 thousand of records.

MySQL (MyISAM) – 5.1.49
MySQL (InnoDB) – 5.1.49
MongoDB – 2.0.2
PHP – 5.3.6

All times are in seconds, and each query is executed in a loop 10 times and the result presented is the average of these 10 performances.

MySQL (MyISAM) MySQL (innoDB) mongoDB
WHERE field = ? 3.631 21.911 0.016
WHERE field zLIKE ‘x%’ 3.755 19.562 0.040

The results speak for themselves – mongoDB is perfect for large databases, where the advantage over MySQL is the most visible.

Leave a Reply

Your email address will not be published. Required fields are marked *