8 ms·
Change your data model so that you don't need to aggregate. Duplicate if necessary, handle the resulting potential inconsistency. Have the right indexes; espec
by rinens 12y ago
Change your data model so that you don't need to aggregate. Duplicate if necessary, handle the resulting potential inconsistency.
Have the right indexes; especially with complex aggregation you might be surprised to find they aren't being used due to a quirk of your query.
A single mongo instance can handle a beefy load, but not if every read is an aggregation over a million by million by who knows how many docs.
- twunde 12y agoI second the idea of denormalizing your data. It feels odd because that's exactly what you're trying to avoid with relational databases, but honestly, mongo is designed to handle denormalized data http://blog.mongodb.org/post/88473035333/6-rules-of-thumb-for-mongodb-schema-design-part-3 http://blog.mongodb.org/post/88473035333/6-rules-of-thumb-fo...