Our application selects the correct database server from the database server pool. Thus, each request is 2 requests, and they look like this:
- Get the correct database server
- Run request
We do this so that we can take database servers online and offline, if necessary, as well as for load balancing.
But the first query seems that it can be cached into memory, so it actually queries the database every 5 or 10 minutes or so.
What is the best way to do this?
Thank.
EDIT this for the Pylons web application
source
share