Versioning Guidelines

I am going to create a site where users will have the opportunity to edit the previously submitted form data. What I was asked to do was track all the changes using some version control system in the database. I'm still not quite sure about the data structure that I will work with, but I try to think of a better approach to this type of version control system. If I assume that most of the tables in the database will be editable, then I need to come up with a reasonable and scalable approach to this.

I am currently considering a simple approach that, instead of updating a row with edited data, creates a new row in the same table. When receiving data for display, the query will retrieve data based on the last time line (or a specific flag shape to indicate the version order). One of the problems that can arise here is that changes in one table must be cascaded to related tables. Ensuring referential integrity using InnoDB will probably not work with this approach, as newlines / identifiers will be generated. This may require a different approach when I set triggers that are activated in the UPDATE statement and that handle all the necessary changes to the crosstab data.This can take the form of creating table mirrors with additional columns for recording date / version.

If anyone has suggestions for a good general approach to handling this type of thing, I would really appreciate some advice!

+3
source share
2 answers

This is a good and deep question, which, no doubt, cannot be answered seriously without understanding the types of workloads that you will be dealing with, the actual requests that need to be fulfilled (you must comment on them!), The variety of information for versions, etc. .d.

But as for the general approach, I would start with a simple solution with which you can experiment and compare. From this specific case study, develop a more robust example that you will elaborate on using lessons learned from your initial attempt.

: -

, , , , , ( ).

, , : - Transactional-update/delete .., . ? " ", , (, ), !

(, , ), , .

+3

- . , , - .

0

Source: https://habr.com/ru/post/1735807/


All Articles