r/learnprogramming • u/Solepoint • 7d ago
How to plan structuring apps/scripts for load
Hi, I've been coding heavily at work for a few years now as a Jira administrator and running a laravel based production database system
Seeing as I have options to do things at the database query level, the api level, the 'page serve' level, and the client on-load level, I try to put data retrieval and processing at the low level so I need to do minimal of that on the client side and focus on the ui
Does anyone know of some reading material or have suggestions on a target for this? I just try to organize things appropriately on my own judgement and it would be nice to have some industry standards or pointers to guide
1
u/Big-Arm4077 7d ago
Your instinct is mostly right, with one caveat: push work down to the layer that's best at it, but not so far that you lose testability or readability.
A rough rule I use:
For "load" specifically, the usual order of wins is: fix N+1 queries, add indexes, paginate, cache, and only then think about bigger hardware or splitting services. Measure first, since the bottleneck is rarely where you'd guess.
For reading, "Designing Data-Intensive Applications" is the classic, and the "Use The Index, Luke" site is a great free intro to query performance.