Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MongoDB map reduce

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently migrated a personal google maps based web app from a Mysql database to MongoDB.

I found the mapreduce APIs kind of difficult to use in java, because they expect javascript code as strings and munging javascript code with the right escaping for double quotes and so on was a pain.
Eventually, what I did was write the mapreduce code in js files, and later read them as strings and pass those strings.
Nevertheless, it still seemed rather inefficient to me to pass code from client side, especially if the MR code is complex or executed often. I'm not sure if this is how it's supposed to be done.
If we look at mapreduce functions as analogous to the stored procedures of RDBMSes, then would it not make for less latency to deploy them just once on the mongo server side and call them by name? Is that possible?

Also, from your book TOC, it seems like mapreduce capabilities are not covered. Is MR not seen as a priority for mondodb? Are any new MR features planned?

By the way, I for one have been impressed by mongo's spatial query capabilities, the fact that it leaves the choice of strong or eventual consistency in hands of developer, and also by the document oriented paradigm which certainly reduced the friction against adding new features. I hope full text search is also in the pipeline. Great product overall!

 
Arun Radhakrishnan
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Karthik

I don't think Map Reduce is tied to MongoDB in any manner. You could use any data-source with Map Reduce.
 
Kyle Banker
author
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karthik,

The MapReduce API is a bit difficult to use, I agree. But the biggest problem with MongoDB's MapReduce is that it's kind of slow for large data sets. MongoDB 2.1 (unstable) includes the new aggregation framework that will replace MapReduce for most purposes. It's a lot faster, if a bit less flexible, than the current MapReduce. You can read about it here:
http://www.mongodb.org/display/DOCS/Aggregation+Framework

The main reason I chose not to spend a lot of time in the book on MapReduce is precisely because this new framework will become much more relevant to most developers with the next release.

Regards,
Kyle
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply and the info on upcoming aggregation APIs - will try them out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic