3 ms·
We do a variant of this for most of our data, except we use the version attribute (also used for optimistic concurrency) instead of a timestamp to identify chan
by kevan 7y ago
We do a variant of this for most of our data, except we use the version attribute (also used for optimistic concurrency) instead of a timestamp to identify changes in the history table. Our change velocity on most data is really low so the audit trail is basically free.
Another pattern to achieve the same goal is v0/vN records, where you store all versions in the main table but keep the most recent info in v0 for quick querying. This[1] SO answer has a lot of context on the tradeoffs between the approaches.
[1] https://stackoverflow.com/a/54600512/2811887 https://stackoverflow.com/a/54600512/2811887