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 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.