We are very pleased with our choice, which uses two tables for an object with a version.
The tables look something like this:
Person table:
- id (PK)
- version (counter for optimistic locking)
- current (foreign key
person_version ) - ... (any property that does not change)
person_version table:
- id (PK)
- person (not null) (foreign key reference
person ) - timestamp (used for sorting)
- ... (any property that may change)
Since records in person_version will never change, they are easy to cache (as long as there are no references to tables that may change)
source share