Presentation is loading. Please wait.

Presentation is loading. Please wait.

Author: Miran Miklič miran.miklic@gov.si Comparison and advantages of the Bitemporal and Temporal databases over Tuple-versioning (point-in-time) database.

Similar presentations


Presentation on theme: "Author: Miran Miklič miran.miklic@gov.si Comparison and advantages of the Bitemporal and Temporal databases over Tuple-versioning (point-in-time) database."— Presentation transcript:

1 Author: Miran Miklič miran.miklic@gov.si
Comparison and advantages of the Bitemporal and Temporal databases over Tuple-versioning (point-in-time) database systems like SDMX Registry Author: Miran Miklič

2 Versioning/Temporal/Bitemporal model
Current SDMX Registry Versioning/Temporal/Bitemporal model May 2011

3 Current SDMX Code Lists
Versioning/Temporal/Bitemporal model May 2011

4 Current SDMX – Valid From/To is usually empty
Versioning/Temporal/Bitemporal model May 2011

5 Versioning/Temporal/Bitemporal model
Versioning problem Versions enables the people to distinguish the data in time, but there is no metadata needed about time With different version we can only specify, that the data has been changed, but not when exactly and why It is very hard to maintain such a system with hundreds or thousands of elements, each with many versions Versioning/Temporal/Bitemporal model May 2011

6 Versioning/Temporal/Bitemporal model
Temporal model is the model where Valid time start and end is added Valid time start should be known, while it is possible not to limit the validity end, can be valid forever or more probable until first change of the data By changing the data we have to use versioning again to enable tracing, however we have to have the versioning of the whole database and not only the single database table Versioning/Temporal/Bitemporal model May 2011

7 Versioning/Temporal/Bitemporal model
Events in time can be used as a basis of changing the data Bitemporal is the model with Valid time and Transaction time Transaction time is part of the Timeline Individual data can be changed each with different timeline Model enable greatest flexibility which is common in daily life Bitemporal model can be user also for the life of data columns but slightly different than usual, instead of deleting the column we can simply stop changing the column and we can create new one Versioning/Temporal/Bitemporal model May 2011

8 Versioning/Temporal/Bitemporal model
Valid Time Valid time is the time when the data has specified value Because of that Valid Time has to have start and end If the end is not specified it is considered to be valid from start, is valid Now and until first change of the data Versioning/Temporal/Bitemporal model May 2011

9 Versioning/Temporal/Bitemporal model
Transaction Time Transaction time start is the time of entering the new data Transaction time end is until first change of the data value, for new data is not specified because it is not known yet Transaction time is a unique part of the timeline, however timeline can be partitioned as to the desired time slice as necessary (daily, monthly etc.) During queries we can limit the Transaction time start to the desired value and effectively limit the time period for the included changes of the data Versioning/Temporal/Bitemporal model May 2011

10 Versioning/Temporal/Bitemporal model
About Codebooks Instead of text we use some key code which is shorter than the text and we store the key code and key text combinations in the separate file Codebooks are usually treated just as simple table By creating Codebooks we have separated the coded data from the key text Codebooks tend to have the independent life of its own It is not common to have central managing of the codebooks, tracking of the changes and have always somebody responsible for the individual codebook Versioning/Temporal/Bitemporal model May 2011

11 Versioning/Temporal/Bitemporal model
Bitemporal Codebook SORS have very positive experience with the codebook organized according to the Temporal model Bitemporal model offers also additional tracking of the data changes We can have one or more codebooks organized according to Bitemporal model and we eliminate the problem of the separation the coded data from the coded test with using the time to join the code and text Versioning/Temporal/Bitemporal model May 2011

12 Some rules: errors and changes
Always mark the nature of the data changes in the database, whether is the change of the data based on the facts or it is just the correction of the errors. It can be essential for some researches like migrations Database should have the ability to eliminate errors during queries Versioning/Temporal/Bitemporal model May 2011

13 Some rules: golden rules for tables
Primary key is unique and is never changed; sequence number is the best candidate Primary key should have no relation with the data, do not use Social security number, Tax number, centroid etc. as primary key, such data are data which can be changed! No data record is ever deleted, they are only mark as deleted or in case of the Bitemporal model Transaction-time End is set. Do not assign the primary key of the deleted data to different piece of the data, not applicable to Bitemporal model (hopefully) Versioning/Temporal/Bitemporal model May 2011

14 Bitemporal model – Time split and Time join
New functionality specific to the Bitemporal model is Time split and Time join Time split on the given date to produce two databases which consist only of the data up to the given date and from the given date. Appropriate end and start data values should be interpolated. Time join of the two databases; end and start data values should be eliminated. Versioning/Temporal/Bitemporal model May 2011

15 Bitemporal Database with Timeline
Simplified model of the new SDMX Registry is shown as an example of the Bitemporal Database with the Single Timeline Primary Key is the join element and is basically the Event sequence number Validation and Transaction dates are only in the single Timeline table Codebooks are also in the single table with the common Primary Key column All other tables can be created as usually with adding only common Primary Key column Versioning/Temporal/Bitemporal model May 2011

16 Bitemporal Database with Timeline - shematics
Versioning/Temporal/Bitemporal model May 2011

17 Proposed Login to SDMX Registry
Versioning/Temporal/Bitemporal model May 2011

18 Versioning/Temporal/Bitemporal model
SQL/Temporal SQL/Temporal has been proposed to be ISO SQL 2003 standard Project has been canceled due to the lack of progress In late 2010 commercial firms started to support the Bitemporal model building on the guidance from SQL/Temporal initiative It is expected that during this year some kind of SQL/Temporal will be standardized as ISO standard Versioning/Temporal/Bitemporal model May 2011

19 Versioning/Temporal/Bitemporal model
Thank you Questions? Versioning/Temporal/Bitemporal model May 2011


Download ppt "Author: Miran Miklič miran.miklic@gov.si Comparison and advantages of the Bitemporal and Temporal databases over Tuple-versioning (point-in-time) database."

Similar presentations


Ads by Google