Hi, I finally understood how ember does the relationships between the models. Now I’m facing the big question: should I embed all relationships with the first request or should I load them asynchronously?
I have a model ‘Institute’ which has many ‘Cases’ and also many 'Slides’ The model ‘Case’ has many ‘Slides’ too. The ‘Slide’ belongs to ‘Case’ and the ‘Institute’
The number of slides per institute or case can get really really high. So if might not want to embed the slides with the institutes and the cases but load them only if needed. Now I don’t understand what ‘needed’ means… If the view touches the actual model or if the controller does? And how many at a time are actually requested then, because I would only like to load like a 100 and request the other 100 if really needed.
I thought about embedding the first 100 slides, sideloading them and somehow lazyload the rest if needed, but I guess that’s not really an option.
I just can’t really find any productive example where the performance is a concern and what the best practice is for related data which can get really really big… Maybe you have some advise in how to something like this… I have also been thinking about pagination and if I should link the pagination to actually loading/requesting the data from the API.
I also don’t like to add the id-array of the related slides as a get parameter, do you know how to change that into a body/POST request with the id’s in the body. And I was also trying to figure out if I could load the slides async but not by the slide-id-array but by the institute or case-id given… But it seems like that’s not good practice? (The API I’m requesting is designed like that, but can be changed as well)
Thanks for any advise on my many unsorted questions, tell me if you need any more information for a solid answer.