1 year ago

#380251

test-img

joethemow

MongoDB is not scaling

I am building out some tools that require <1s response times and using Mongo (or SQL for that matter) will resolve that. I am pretty sure that I'll need to either use Redis or some in-memory data structure. Right now my Mongo aggregate takes almost 5 seconds to load 30 rows. All the collections are indexed but there are lookups within lookups which I think is where the issue lies (i.e. having a reference to the user and having multiple users, need to get their personal info). I also have pagination enabled and on Mongo 5.0 (which uses indexes for sub lookups) Few questions:

  1. Should I just switch to a SQL database?
  2. Should I add change streams to the collection I need to query and update a redis instance and read from there?
  3. Should I just embed the information I'm extracting from the lookups into the parent document
  4. Do 2 and 3?

mongodb

performance

redis

latency

0 Answers

Your Answer

Accepted video resources