Good practices and recommendations
Here are some of the best practices that should be followed while working with MongoDB:
Use indexing judiciously. Try to keep multikey indexes such that we do not need to duplicate indexes. Database writes are slowed down with lots of indexes, but reads could be fast. We need to strike the right balance.
Use the aggregation framework as often as possible. Remember Mongoid caches results for even better performance.
MapReduce is a great tool to get faster aggregated results. However, you cannot use it with multiple collections.
Know when to use Text indexes, it's fine for really simple searches but not good if you want complex facet queries. If you require complex facet queries, I recommend looking at ElasticSearch.
Use the hash index for basic field searches, but not for multikey searches as we have seen.
Keep an eye out for slow queries.