Replies: 3 comments 1 reply
-
Hey @vstarush — I think we can get to the bottom of this. Here are some questions for you that might help you narrow down the cause.
In regards to bullet 1 above, if you are seeing the slowdown while performing We have lots of projects that have 6K+ records and they're still blazingly fast. For example, a Another thing you could try to do is use the If you're often retrieving categories in that context, I'd set Another idea that we could do, which would take advantage of MongoDB's NoSQL nature is store movies on categories as "embedded" documents. Just take the field schema from movies, and re-use the fields exactly within your categories collection. Then write an Last note - soon, we are going to build a performance enhancement that "batches" queries together from the same collection, which in your case would reduce the 50 queries to This performance enhancement will be released by 1.0 and you can read more in this discussion. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hi @jmikrut ! Sorry, I had to give more explanation (although you gave so many interesting ideas that I am partially happy I didn't explain the problem well enough! :) So the API is still blazing fast, I am using "REST / where" queries for search and I did index couple of fields in movies collection so there is no problem there. API is very good! The problem is when we log in CMS itself, and for example need to check something in customers collection, or update couple of specific movies, or add movies to categories, or check transactions, which eventually might hit the number or a lot more than 6k, or just browsing CMS entries, the interface loads and switches the collections much slower compared if you have a relatively empty CMS. Which is understandable, cause it is a lot of data. But maybe there anything we can do to improve that user experience in CMS? Essentially the CMS UI load time I guess. |
Beta Was this translation helpful? Give feedback.
-
This actually really does make sense! Yes, the list view of categories and the category object with the array of movies loads slow. And movies themselves do not have any relationship fields at all. And they are actually loading ok. What do consistently load very slow are the categories. And then when you constantly go back and forth between the categories and movies, it creates this unpleasant experience of the CMS loading slow. For example, if you switch to categories and then quickly switch to movies, the CMS seems to be still loading categories and then, once it's done, loads the movies. I tried your solutions to set maxDepth on the relationship field of movies inside categories to 0 and it seems to be working, loads much faster in CMS! The problem is now that in the frontend I am relying on that depth 1 because I am loading the movies from the category, since I need that particular order and it is convenient to just have movies information within category itself. Is there a way to set depth separately for CMS collection list view and then to specify depth in the query? Or what would be in your opinion the best solution? The structure of categories: category
Thank you!! |
Beta Was this translation helpful? Give feedback.
-
Hello,
In our project we have collections of approximately 6k entries. And then we have other collections that arrange these entries in various particular orders. For example:
Collection "movies" has 6k+ movies (objects with ~10 fields).
And then we have multiple categories like "Action movies" where there is an array component with each item in the array being a reference (relationship field) to a movie (order is important). Each category has ~50 movies and there are ~30 categories.
We noticed a significant drop in how fast the CMS works when added all of the movies and I was wondering is there anything we can do to improve the performance? Any ideas welcome :)
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions