In your experiences, how have you handled running a lot of database queries across a slow line?
It really depends on how timely you want the report to be. Your options are basically:
- Query on Demand. Go after the data whenever you need it. This guarantees fresh data, at the expense of a slow running application.
- Schedule the Query. Arrange to run the query in advance of your application, on some set schedule. Your data won't be as fresh, but the application will run quicker since it only has to deal with cached data.
- Schedule a Remote Query. Run a scheduled query, but do it remotely (on the database server). This is a win if you have a slow line, but have to process a lot of data to get the summary that your application will use. The results of the remote query can be retrieved on demand, or pre-sent so that your application doesn't have to suffer retrieval time.