Databases Reference
In-Depth Information
Versioning is the IT community's way of providing queryable
access to historical, current and future data. However, there are
far too many variations of versioning to make an exhaustive
review of them possible. So in this chapter, we will distinguish
four main types of versioning, and will discuss one representa-
tive method of each type. Those four types are:
(i) Basic versioning;
(ii) Logical delete versioning;
(iii) Temporal gap versioning; and
(iv) Effective time versioning.
In this chapter, we will use several variations of a version
table, and a corresponding non-temporal table, to present the
basic mental model which we believe is essential to understand-
ing how to manage versioned data. That mental model is that
conventional and version tables of the same persistent objects
(customers, policies, etc.) are related as follows.
An object is represented in a non-temporal table by a row
which is put into that table at a certain point in time, may
be updated during its tenure on the table, and may eventually
be removed from that table. These three stages in the life history
of an object as represented in a non-temporal table are
inaugurated by, respectively, an insert transaction, zero or more
update transactions, and zero or one delete transaction.
That same object is represented in a version table by a series
of one or more temporally tagged rows. The object that is
identified by a primary key in the non-temporal table is, in the
corresponding basic version table, represented by that primary
key plus a clock tick. So the primary key for the first row for an
object to appear in a basic version table contains the object's
unique identifier and the date the row was inserted. For each
update to that object, a new row is inserted into the version
table. That row has the same unique identifier for the object,
but its date is different than the date of other rows for that object
already on the table because its date is the date it is inserted into
the table. As for a delete, some approaches to versioning carry it
out as a physical delete, and others as a logical delete.
A Non-Temporal Table and a Basic
Version Table
Figure 4.1 introduces the diagram we will use to compare a
non-temporal table with various types of version tables.
Two tables are shown. The one on top represents a non-
temporal table of insurance policies. The one below it represents
 
Search WWH ::




Custom Search