I have read a lot of good things about Couchbase and would like to migrate our project from MongoDB to Couchbase. To get started I imported a single Collection (table in MongoDB) into a bucket in Couchbase.
The collection has these metrics:
Number of documents: 6884
Size total: 199,5MiB
Average Document size: 29,7KiB
I tried to compare a typical operation between MongoDB and CouchDB to group documents by a single field and count documents per distinct field entry. The field has a index on MongoDB and CouchDB side.
Aggregation pipeline consists of Group stage also generating the count, a sort stage sorting by count DESC and an output stage to write results in a temporary collection
Timing: 0.300 - 0.600ms
SELECT destination, Count(*) As count FROM Mice GROUP BY destination ORDER BY count DESC;
Timing: 2.9 - 3.0secs
That is 5-10 times the amount of time it takes in MongoDB.
I created the index for “destination” field like this:
Is there anything WRONG with my attempt?
How can I speed up the grouping?
Thanks for your help.