S
S
sergeypid2012-03-03 10:27:51
MongoDB
sergeypid, 2012-03-03 10:27:51

MongoDB for data aggregation

Who has experience with large databases on MongoDB, please tell me how it is intended or not (it counts quickly or slowly) for calculating sums, averages, etc., which can be expressed in SQL as SELECT SUM (X) FROM T WHERE Y > 10 AND Z < 100

Storing in json/bson does not seem to hint at the performance of such operations, but the ability to cluster and store large volumes of MongoDB is very captivating ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
alesto, 2012-03-03
@alesto

Here read.
www.mongodb.org/display/DOCS/Aggregation#Aggregation-Group

A
Andrey Shaydurov, 2012-03-04
@GearHead

Map/Reduce is one of the main directions of MongoDB development, its performance on such operations (if everything is done correctly) is much higher than on MySQL. however, you should not immediately rush to use it for this reason alone. mongo has a lot of pitfalls that you never thought about in MySQL, such as: aggressive caching of the entire data-set (it makes no sense to run mongo with a large data set if something else is spinning there besides mongo) and global write lock (mongo is generally designed for quick reading, but inserting into it is hell and horror)

T
TimTowdy, 2012-03-04
@TimTowdy

It does not count quickly, because it will all be counted by a single-threaded javascript. In addition, aggregation in mongo is usually not designed for realtime. If you need aggregation and clustering, look towards column-oriented dbms or hadoop. Or stay on SQL and don't suffer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question