0

I have a report that takes too long to be assembled, so I would like to make a CronJob (with rufus scheduler gem) to generate the report after midnight when there´s no traffic on my application.

The question is: do I need to save the result of the CronJob routine in a DB table or can I have it by mantaining it on a Global Variable for example. Is this possible? Is this usual and safe?

The objective is to have the report without using de DB. So I would generate an (lets say) array with all the daily data of the report, and with the UX I would manipulate my report as I want without messing with my DB that makes my server (AWS) get loaded and slowing down the entire website. That way, my controllers would use the Persistent Array to generate the reports and my server will keep running fast.

Hamdan
  • 183
  • 15
  • why don't you save it in a file on your server? I am saving some reports in a file (but not consulting it via UI) and then sending me some daily and weekly summary to check if the scheduler is still alive – sissy Mar 10 '14 at 15:27
  • It is an alternative... Is your reports very heavy do be made like mine? I have like 100 entries and sometimes i think maybe there could be a way out of this... but except from the report, my app is smoking fast... lol – Hamdan Mar 11 '14 at 16:22
  • well i'm just opening to users my application, so i still cannot evaluate with precision how big my report will be, but in my case is just to check scheduler is up and running well. – sissy Mar 11 '14 at 17:08
  • I runderstand... its ok.. ill try some alternatives. thanks for the suggestion. – Hamdan Mar 12 '14 at 17:13

0 Answers0