I have a relatively simple program which displays information and activity of users which - due to the architecture of the program requires referencing lots of different data in different ways.
For example I have a users who can have different levels of status within different or multiple groups and these groups can have their own statuses. My question is about best practices for referencing lots of data and the speed/logic of the code.
- Option A - have several instances data within the data base and reference this and update this individually over several tables using simple statements and queries.
- Option B - use many nested queries and if statements to retrieve multiple bits of data
Simply put: is it best to use lots of nested queries within loops and if statements, or break the different sets of data up with in a database and reference them individually? I'm after reliability and speed rather than technical wizardry.
I know this may be very specific to my program, but I would like to know the general opinion of developers out there and their experience without getting too deep in to examples.