MongoDB and MySQL in Ruby and PHP
Some time ago, I became quite interested in developing for MongoDB and spent some benchmarks in comparison with MySQL. Initially, only in Ruby, but when the results were astonishing (for the worse), then in PHP, for comparison.
Maybe this will save someone some time.
Initial data:
- System:
$ uname -a
Linux pavlin.ik 2.6.31-gentoo-r4 #1 SMP Sun Nov 1 18:21:31 MSK 2009 i686 Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz GenuineIntel GNU/Linux - MongoDB v. 1.0.1
- Gems:
- gem mongo (0.16)
- gem mongo_ext (0.16)
- gem mysql (2.8.1)
- ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
- ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]
- ruby-enterprise-1.8.7-2009.10
Actually, the results: There is

only one conclusion: this does not mean that MongoDB is worse than MySQL, it means that a normal, fast driver for Ruby has not been written for it :)
PS will be cool if someone conducts similar tests for Python.
PPS take this opportunity to say hello to TravisBickle ;)