Is mongoDB effective in multiple searches?

I evaluate MongoDB based on Membased / memcached because I want more flexibility.

Of course, Membase does a great job with fast (multi-user) searches.

I like the advanced options that MongoDB gives me, but are you also quick to do multi-task searches? I saw the operator $ or and $ in, and I'm sure I can model it. I just want to know if he is a performer (in the same league) as Membaza.

for example, Lucene / Solr returns 20 product identifiers. View these product identifiers in Couchdb to return documents / related fields.

Thanks, Gert-Jan

+6
source share
2 answers

In your use case, I would say this, in my experience: I hacked some analytics into my database, which made a lot of $in queries with thousands of identifiers, and it worked fine (it was a hack). To my surprise, it worked pretty well, at the bottom of the millisecond.

Of course, it is difficult to compare this, and, as is the usual theory, a poor companion when it comes to performance. I think the best way to understand this is to transfer some test data and send some requests to the system.

Use the excellent MongoDB built-in profiler, use $explain , save one pointer to the query rule, look at the logs, follow the mongostat and do some tests. This should not take too much time and give you a definite and affirmative answer. If your queries turn out to be slow, the people here and in the newsgroup probably have some ideas on how to improve the exact query or indexing.

+3
source

One index for each query. It was sometimes thought that requests for multiple keys could use multiple indexes; this does not apply to MongoDB. If you have a query that selects multiple keys, and you want to use the index efficiently, then a composite key index is needed.

http://www.mongodb.org/display/DOCS/Indexing+Advice+and+FAQ#IndexingAdviceandFAQ-Oneindexperquery .

More information on this page can also be found in relation to indexes.

The bottom line is that Mongo will be great if your indexes are in memory and you index the columns you want to query using compound keys. If you have poor indexing, then your performance will suffer as a result. This is largely consistent with most systems.

+1
source

Source: https://habr.com/ru/post/903199/


All Articles