MongoDB first impressions

For a customer we have developed log analytics software. It’s currently uses MYSQL as the database backend. The system reads in a hourly log file, and calculates all kinds of fancy statistics. I wanted to see how the system would work if I used MongoDB, a schema-less document DB, instead of MYSQL. My impressions in no particular order:

  • Importing log data is much easier than on MYSQL because MongoDB is schema-less. Just create a collection (=bucket) and insert every log line into it as a hash. For log files/2012/05/2012/05 that don’t have a fixed amount of fields, it’s a great fit.
  • Like MYSQL, you do need to create indexes to make searching fast(er).
  • MongoDB supports map reduce operations. It made some of the calculations much more elegant and better readable than the code that was written for MYSQL.
  • Chaining of map reduce operations is supported, and works as you would expect.
  • Queries are written in javascript. I’m happy that they didn’t invent yet another ‘scripting’ language. Javascript looks capable enough.
  • Map reduce operations are not particularly fast. They are upgrading their javascript engine to V8 to improve the execution speed.
  • MongoDB community is nowhere near the size of MYSQL. Don’t expect a lot of Google results for a specific mongoDB issue. The moderated Google group is a better place to go currently.
  • I liked the API. Calls are not verbose and their intented use is easy to understand.
  • Although quite capable, mongoDB is still a young project. I need to have more time with it before using it on a customer project.

4 thoughts on “MongoDB first impressions

  1. What kind of “frontend” do you use for this application? I’m interested in trying out MongoDB myself in a Rails project, but worried it might take some time getting used to. Any experiences starting a project with MongoDB vs. Mysql/ActiveRecord?

    Thanks for the write-up! Looking forward to more interesting posts about Mongo :)

    • Hi Lars,

      I used the mongo ruby driver for my experiments. A colleague recommended Mongoid for Rails mongodb usaged. It supports some pretty syntactic sugar for chaining criteria and named scopes.

      No experience yet with using MongoDB on a customer project. Because it’s very young, the implementation for full text search with MongoDB is immature. As pretty much all of our customer projects require heavy use of sphinx / search this might be a reason to hold off for now. There is a MongoSphinx gem, but the use of XML to transfer data just feels dirty. ;-)

  2. Pingback: Twitted by nosqlupdate

  3. Pingback: Tweets die vermelden /dev/tty: MongoDB first impressions (Uncategorized) -- Topsy.com

Comments are closed.