I ran three micro-benchmarks: get by primary key, get by secondary key and update by primary key. MySQL had a higher peak QPS for all of them. Alas, the results for get by primary key were skewed because pymongo, the Python driver for MongoDB, uses more CPU than MySQLdb, the Python driver for MySQL. The client host was saturated during the test and this limited peak QPS to 80,000 for MongoDB versus 110,000 for MySQL.
I repeated one test using two 16-core client hosts with 40 processes per host. For that test the peak QPS on MongoDB improved to 155,000 while the peak for MySQL remained at 110,000. That is an impressive result. The results for get by secondary key and update by primary key are still valid as the server host saturated on those tests.
A couple of lessons I’ve learned:
- if you are able to use the latest MySQL version and track different patches you can get a lot out of MySQL
- while benchmarking, make sure you also check very carefully the drivers you are using
- while benchmarking, pay attention to how concurrency is influencing the results
- peak QPS is an interesting metric, but it might not be the one you are most interested about. Check out this extensive Riak benchmark run by Mozilla that covers other metrics that might be important for your app