Backend - Best practices, fetching

Hi, I want to fetch data from backend with specific Id, that is based on another data from backend. I fetched the reference ID earlier. However, what happens when I used it as reference, will it fetch once more? Or should I put the reference ID in a variable after the initial fetch? Thank you