Answer the question
In order to leave comments, you need to log in
DB - comparison of previous versions of tables with the current one
I would like to invent a bicycle that will be a database that saves changes or states for each day in one way or another and be able to compare with the current state of the table.
There is information (let it be, about orders) that is planned to be added “manually” (csv or xlsx, for example) to the database every day. Changes occur in several fields at the same time, and in almost every line, incl. field logging doesn't seem like the best option.
I would like to see (automatically and interactively, ha) the changes that have occurred and be able to compare table versions on different days and find the delta between them.
Tell me, please, how best to implement this miracle.
So far there have been 2 options: a separate table for each day (at least a month) and, for example, subtract one from the other. Or update triggers, which are quite an option, but how to restore the state of the entire table to the past date?
I am very interested in both general architecture tips and specific technologies that are best used.
Thank you.
Answer the question
In order to leave comments, you need to log in
I usually store such things in one table, I just add one more field with the version number.
Versioning should be normal.
There are several ways to organize. For example, for each object, specify the lifetime.
Well, or buy Oracle, 11 has built-in versioning.
There is something like an introductory part, not everything is perfect, but more or less habrahabr.ru/post/101544/
And the network is full of information on data versioning.
> Tell me, please, how best to implement this miracle.
Of course, write yourself. For storage, you can use, for example, a revision system (as in Wikipedia) (1 table stores the current values, another, archive, all previous revisions of the records).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question