I am currently running a Slash back end and am trying to figure out how I could cost-optimize my queries.
My app is a standard social media style application. Hence, most operations would be queries for user- and post-data. With a standard feed with infinite scroll, sorting posts by date, how can I optimize my queries, to lower the cost?
Is it better to continiously load small batches of ~10 posts/users at a time as the user scrolls, or would it be more cost-efficient to load bigger chunks of data at the risk of overfetching?
When I load a standard feed with only previews of the respective posts, would it be better to load everything for every post and then only pass it through as an arguments as the user navigates to a detailed page, or should I only load the data required for the preview, and then load the rest when a user decides to navigate to the detailed page of a post?
In other words, should I optimize for loading minimal data, or minimal number of queries, with more data?
Thankful to any advice.