Better HN
topnewbestaskshowjobs
Log inSign up

rinens

3 karma · joined Dec 20, 2014 (11y ago) · 1 submissions

Submissions

comment 11y ago · link · parent

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.