Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A classic problem - and one that doesn't have one <em>right</em> answer - as always, it depends :-)</p> <p>The core issue is: do I retrieve a user with all its associated information (potentially making it a really big chunk of data being transferred), or do I make multiple calls to retrieve certain parts of information when needed.</p> <p>I typically tend to lean more towards the second option - retrieve only as much data as you need <em>right now</em> - and go back for more if you really need it.</p> <p>In my experience, often times, users will only use certain aspects of your app - so in some cases, someone might need the core user info, plus addresses. In another, another user would require core user info and their permission - or whatever. Hardly ever will someone need all the available data.</p> <p>If you load "on demand", you do incur a bit of additional overhead and time to load the data - but typically, you're saving a lot of time transferring data that you don't need in the end (when you load everything at once).</p> <p>Again: this is really just a "tendency" in my apps - I don't have any cold hard numbers to back up my observations and prove that this is the right way to go. It's just my own "best practice" for most cases.</p> <p>But again: getting this right borders on black magic :-) so you'll probably just have to try one approach and see if it works (or not) and then potentially rearchitect your solution once you have some facts as to how your solution works in real life use.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload