In this new post to his blog, Brandon Savage looks at a few methods you can use to help reduce the overhead connecting to the database can cause.
Below are a list of my top five quick-and-dirty strategies for improving database performance in web applications. These suggestions are culled from recent experience and mixed with some ideas that I've implemented in my own code. They're not high level, but they are something we need consistent reminders about.
Here's the short version of the list:
- Try caching
- Reduce the number of queries that run
- Use indexes
- Optimize data usage
- Avoid functions in WHERE statements
You'll have to check out his post for the full versions, though.