Openhood

Benchmark various MongoDB ORM for Ruby

Image by by Terry Vlisidis on unsplash

Inspired by a benchmark of MongoDB versus SQLite by Jeremy Evans, the famous author of Sequel, here is a benchmark of MongoDB via the mongo ruby driver versus Sqlite via Sequel:

Mongo versus Sqlite

The faster “select alls” can be easily explained: SQLite ids are simple integers whereas mongo ids look like this:

BSON::ObjectID('4c4b20a41a221842e3000002')

So there’re simply more data the gather each time. Sqlite is quite fast in fact, but don’t forget that it offers neither concurrency nor scalability.

More interesting is the following chart featuring MongoMapper versus Mongoid versus plain mongo ruby driver:

MongoMapper versus Mongoid

And here’s more ODM bench:

MongoModel versus Candy versus MongoRecord versus MongoDoc

The source for all these benchmarks is freely available on github.

Copyright © 2024 Openhood SARL