Study case:
If I have for example The library object.
In the library are books.
Every book have common information like Name, Date, …. And some other dependencies like Autor, Reseller, ….
I have Person object.
If Person read the book, then I want make new record into history.
And now the problem, what is better:
1) Create static record in history with all data from Book entity and his dependencies (In this case If the Book will be changed, then history will not be actual)
or
2) Strore dependecy on Book object (In this case history will be actual, but in every request I must look at all dependencies)
I suppose that Books will be changed offen
And the History will be displayed in Person profile. (This assumption response will Answer 1) )
But should be history based on actual Book datas ? Or history should have the information form date where history was created ?
Book and Person are only examples
Not sure what you actually mean by “actual” here, but the better choice is the one that suits your needs.
With option 1, when you later show the history record in your Person Profile, it will contain the information about the book which was current at the time the history record was created. With option 2, the profile will show the information about the book that is current at the time the profile is viewed.
Which do you want to see in the profile?
If in fact you want to always show information that was current at the time of the history record creation, this is one of the reasons for building a data warehouse with a time dimension. If this is what you need, and if it’s something you need to do with alot of history data, you might want to look into building a data warehouse separate from your transactional database.
For some information on data warehouses, this IBM Redbook article might be useful.