php – Building a robust historical system

I work on a CMS platform that has many modules, each module having options to modify the entries of a database.

I need to write a history system that can show me a snapshot of the database at any time.

For example, if I have three tables and I add, edit, and delete entries over a period of one week, then I want to know the status of the platform at a specific date and time this week . What is the best algorithm / logic to implement in the code?

I have requirements:

  • there should be no errors in the display of the data;
  • storing each action in the database is not an option, as there will be millions of actions per day (storage space can be a problem);
  • I would rather not use a framework, but implement the algorithms myself.

Some technical specifications: Frontend: HTML, CSS, JavaScript, Bootstrap, jQuery. Backend: PHP + MySQL.

Any suggestions or links to technical documents or best practices are welcome.

Thank you.