Generate the report as a whole and "on the fly", or as the arrival of data?

Need to get the reporting tables in the Annex. What advice would you give about the algorithm of formation of the report? While there are 2 options.

1. Means the permanent storage of the accounting document in the database. To update the same document in the database, as the arrival of new data in the system. As soon as the data came immediately added to the database, another accounting entry. When the report is requested by the user, retrieves all lines in the accounting document from the database, and simply displayed.

2. Do not use the reporting database. The entire report is generated on the fly, without storing in the database. This occurs with each request the report to display, by iterating over the entire database and retrieve the correct data, and then formatting. For each individual query to display a report, the document will be collected again and again, the algorithm traverse the database system.
June 10th 19 at 14:39
2 answers
June 10th 19 at 14:41
the report is not stored in the database and is generated on the fly, and updates only the new data and old no
June 10th 19 at 14:43
it all depends on the project ... if You have a small project with a small amount of data (I mean data on which to build the report) which will benefit a few users - then the easiest way to build a report on the fly.. If a project with a large amount of data, which will benefit a large number of users - then it is appropriate to form a pre-report in the database.

Find more questions by tags AnalystDesigning softwareDatabasesProgramming