title: best practices for weight on database or software
body: <p>I have a question i have been wondering  about for a while. When working with big databases, there is always a point where software gets slow. Usually optimizing the weight will help the performance a lot. For example avoid the database to loop trough big collections many times, when your software can just do it in one time. Make put calculations in ur where clause spread over more tables etc slows down the database a lot. In some cases its also a better idea to get the database to do the work.. for example to avoid a lot of useless data to be transfered.</p>
  
  <p>My question is: what would be the best way to balance that weight? When should the weight be on the database, and when should it be on the client?</p>