开发者

When do I need map reduce for database queries?

开发者 https://www.devze.com 2023-01-17 03:20 出处:网络
In C开发者_JAVA技巧ouchDB you always have to use map reduce to query results. In MongoDB you can their query methods for retrieving data, but they also let you do map-reduce.

In C开发者_JAVA技巧ouchDB you always have to use map reduce to query results.

In MongoDB you can their query methods for retrieving data, but they also let you do map-reduce.

I wonder, when do I actually need map-reduce?

Are those query methods different from map-reduce or are they just wrappers for map-reduce functions?


MapReduce is needed for aggregations in MongoDB. The normal queries follow a very different (and much faster) code path and they should always be used for real-time operations. MapReduce is definitely not intended for real-time, it's more for batch jobs.

Technically, you could write all your queries using MapReduce, but that would be both painful and slow.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号