I have tons of books on php mysql development, but something I can't seem to find is advice on structuring large web projects.
for example -
Is it better to have a bunch of files - each for a function that builds part of the site - or place a bunch of functions in one file? (example - I built a messaging app for the site...I have a messages.php file that has all the functions required - display_inbox, display_outbox, etc)
I have thousands of lines of code at this point and it's starting to get a little hard to manage.
On the database end, my main goal has been to minimize the size of my tables and index wisely while simultaneously minimizing the number of queries to the database per user session. I know there are other considerations involved - caching particularly expensive query results, etc., but I'm just not clear on how other people's thought processes work when thinking about these issues.
I guess I'm wondering if there's a file structure (on the server side) and site flow that works well for people and why it works better than some other system.
I also tend to wonder how many queries are usually involved in building each web page. How many times is a query typically needed for a user session? (Is that a ridiculous question?) Coming from an html/css developer perspective, what is the weight of a query in comparison with, say, loading an image? I know some of these things must sound dumb and must come down to personal preference and must vary quite a bit, but I feel like there must be reasoning for each approach.