asp.net mvc - Moving slow database calls from MVC to background application - advice please -


i have mvc web site, users can search large recordsets sql server , oracle databases. of these recordsets can large, many thousands of records. sadly, user requirement not make searches more specific.

when user posts search request database, web page hanging before timing out (due amount of time taken query database).

we thinking removing expensive database calls mvc site, , sending query separate process run in background. when query complete, can notify user.

my proposed solution is:

1) when user completes search form in web page, display message results being generated , sent when complete 2) send sql query database can contain list of sql queries need processed 3) create windows service checks database every couple of minutes new queries 4) windows service queries database. when query completed, create csv of results, , email user

i looking advice , comments on above approach? folks think of approach process expensive database calls in background?

generally speaking requests made infrequently, mentioned, great amount of data. there chance 2 or more requests made @ same time, infrequent.

i @ optimising databases.

grateful tips.

martin :)

another option supplement existing code execute query on separate thread periodic keep-alive updates can sent requesting page while wait query results. similar way insurance quote agregator pages work. second option make results available hyperlink when ready , communicate either through website or email user. option 3 if these queries not ad-hoc type queries profile frequent combinations , pre-compute them periodically placing results new tables (sort of halfway optimising current database structure). caveat there data won't date - given time queries taking isn't important second?

whichever solution choose think it's going depend on user expectation - know want , send 1 big query , , happy? or try several queries find right combination of parameters? if latter waiting email delivery of results might not acceptable them. if want downloadable results document , know want first time may. problem see here emails going astray or taking longer user thinks should causing request resubmitted multiple times , increasing server workload - caching queries , results idea.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -