I have to build a program that does two things. First, it must have interaction from users to save the current state or roads and road conditions. This involves linking to weather conditions tables, predefined deficiencies, etc. Data can not be deleted from the database and it must allow users to look up road conditions in the past. So, if a deficiency changes, then the historical data must refer to the old deficiency.
Method 1) One way to do this would be to have our deficiency table (and weather table, etc) look like this
DeficienciesTable
-------------
DeficiencyID
OrginalID (Null unless the deficiency gets updated)
DeficiencyName
Description
If a Deficiency gets changed, a new deficiency gets inserted into the database and then the original deficiency gets referenced through OrginalID. I could create indexed views to show only the current information for the transactional side of things, but use this method to store historical information.
Method 2) Another method would be to have 2 different databases, a transactional one for storing the current data and a historical one for past data. Data from the transactional database would be periodically copied into an historical database for storing historical data. The thing is, the table structure for the transactional database would not be that different from the historical one since there is only one data source.
So, does method 2 have any advantage over method one.
Method 1) One way to do this would be to have our deficiency table (and weather table, etc) look like this
DeficienciesTable
-------------
DeficiencyID
OrginalID (Null unless the deficiency gets updated)
DeficiencyName
Description
If a Deficiency gets changed, a new deficiency gets inserted into the database and then the original deficiency gets referenced through OrginalID. I could create indexed views to show only the current information for the transactional side of things, but use this method to store historical information.
Method 2) Another method would be to have 2 different databases, a transactional one for storing the current data and a historical one for past data. Data from the transactional database would be periodically copied into an historical database for storing historical data. The thing is, the table structure for the transactional database would not be that different from the historical one since there is only one data source.
So, does method 2 have any advantage over method one.