Page 1 of 1

Generating offline excel report

Posted: Sat Feb 06, 2010 1:56 am
by nalawadevijay
Hi,

I'm running php site having sql server database. I've given facility to generate excel report having large data in that. Now I'm getting trouble while multiple user download report simultaneously as it slows down the site due to large queries.

so is there any way such that, if one use user requests for report, then it should run in background mode in sql server & may be creating temporary table, then after 10-15 min, php will get data directly from resultant table. so it would save time to wait for executing query & collecting result. This is just one of my idea, so is this possible or please let me know if you've any other ideas.

I'm not sure whether I should ask this question in this category or now. But any help is most appreciable.

Thanks in advance,


Vijay

Re: Generating offline excel report

Posted: Sat Feb 06, 2010 1:16 pm
by Christopher
Generally you would put your request in some sort of queue (often a database table) and then have a cron process items in the queue. You could also use a server like Gearman to do this on one or more servers.

The other side of the question is how the user receives notification. The queue processor could email the user, or the web page could refresh and poll the queue to see if the job has been processed.

Re: Generating offline excel report

Posted: Wed Mar 03, 2010 2:52 am
by nalawadevijay
Thanks for ur reply.

But I'm getting problem, if user requests for "A" report so I"ll create temporary table for that & again if another user try to download "B" report which is different in structure & data from "A", so how can I manage that?

Actually I cant create separate temporary table for each user as there would be many requests simultaneously.

Thanks