open encyclopedia * Article Search: * *
*
*

Temporal database

From open-encyclopedia.com - the free encyclopedia.

A temporal database is a database management system with built-in time aspects, e.g. a temporal data model and a temporal version of structured query language.

More specifically the temporal aspects include valid-time, transaction-time, and bitemporal data.

  • Valid time denotes the time period during which a fact is true with respect to the real world.
  • Transaction time is the time period during which a fact is stored in the database.
  • Bitemporal time is the combination of both Valid and Transaction Time

Note that these two time periods do not have to be the same for a single fact. Imagine that we come up with a temporal database storing data about the 18th century. The valid time of these facts is somewhere between 1700 and 1799, where as the transaction time starts when we insert the facts into the database, for example, January 21, 1998.

Contents

Example

In order to explain how Temporal Databases work, we need a short biography of John Doe. John Doe was born on April 3th, 1975 in the Kids Hospital of Medicine County, as son of Jack Doe and Jane Don't who lived in Smallville. Jack Doe proudly registered the birth of his first-born on April 4th, 1975 at the Smallville City Hall. John grew up as a joyful boy, turned out to be a brilliant student and graduated with honors in 1993. After graduation he went to live on his own in Bigtown. Although he moved out on August 26th, 1994, he forgot to register the change of address officially. It was only at the turn of the seasons that his mother reminded him that he had to register, which he did a few days later on December 27, 1994. Although John had a promising future, his story ends tragically. John Doe was accidentally hit by a truck on April 1st, 2001. The coroner reported his date of death on the very same day.

Non temporal example

In order to store the live of John Doe in a (non-temporal) database table we use this table Person(Name, Address). In order to simplify we define Name as the primary key of Person.

Joe's father officially reported Joe's birth on April 4th, 1975. This means that a Smallville official, inserted the following entry in the database on this date: Person(John Doe, Smallville) Note that the date itself is not stored in the database.

After graduation John moves out, but forgets to register his new address. John's entry in the database is not changed until December 27, 1993, when he finally enters Bigtown's city hall. A Bigtown official updates his address in the database. The Person table now contains Person(John Doe, Bigtown) Note that the information of John living in Smallville has been overwritten. There is no way to retrieve that information from the database. Any official accessing the database on December 28, 1993 would be told that John lives in Bigtown. More technically: if a computer scientist ran the query SELECT ADDRESS * FROM PERSON WHERE NAME='John Doe' on December 26, 1993, the result would be: Smallville. Running the same query 2 day later would result in Bigtown.

Until his tragical death the database would state the he lived in Bigtown. On April 1, 2001 the coroner deletes the John Doe entry from the database. Running the bove query would return no result at all.

Valid Time

The Person table is being extended with two extra fields, Valid-From and Valid-To, specifying when a person's address was valid in the real world. On April 4th, 1975 Joe's father proudly registered his son's birth. An official will then insert a new entry to the database stating that John lives in Smallville from the April, 3rd. Notice that although the data was inserted on the 4th, the databases states that the information is valid since the 3rd. The official does not yet know if or when John will ever move to a better place so in the database the Valid-To is filled with infinity (∞). Resulting in this entry in the database: Person(John Doe, Smallville, 3-Apr-1975, ∞).

December 27, 1994 John reports his new address in Bigtown where has been living since August 26th, 1994. The Bigtown official does not change the address of the current entry of John Doe in the database. He adds a new one:

  Person(John Doe, Big Town, 26-Aug-1993, ∞).

The original entry Person(John Doe, Smallville, 3-Apr-1975, ∞) is then updated (not removed!). Since it is now know that John stopped living in Smallville on August 26, 1993 the Valid-To entry can be filled in. The database now contains two entries for John Doe

  • Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1993).
  • Person(John Doe, Bigtown, 26-Aug-1993, ∞).

When John dies the database is once more updated. The current entry will be updated stating that John does not live in the Bigtown any longer. No new entry is being added because officials never report heaven as a new address. The database now looks like this

  • Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1993).
  • Person(John Doe, Bigtown, 26-Aug-1993, 1-Apr-2001).

Transaction Time

Bitemporal

Remarks/Issues

  • The temporal examples will be added here.

External Links

[TimeCenter]

Contribute Found an omission? You can freely contribute to this Wikipedia article. Edit Article
Copyright © 2003-2004 Zeeshan Muhammad. All rights reserved. Legal notices. Part of the New Frontier Information Network.