{{Short description|Case of database modeling}} {{Multiple issues| {{technical|date=April 2011}} {{refimprove|date=April 2011}} }}

'''Bitemporal modeling''' is a specific case of [[temporal database]] [[Information modeling|information modeling technique]] designed to handle historical data along two different [[timeline]]s.<ref>{{Cite news|url=https://martinfowler.com/eaaDev/timeNarrative.html#dimensions|title=Temporal Patterns|work=martinfowler.com|access-date=2017-04-04}}</ref> This makes it possible to rewind the information to "as it actually was" in combination with "as it was recorded" at some point in time. In order to be able to do so, information cannot be discarded even if it is erroneous. Within, for example, [[financial reporting]] it is often desirable to be able to recreate an old [[report]] both as it actually looked at the time of creation and as it should have looked given corrections made to the data after its creation.

Implementations of bitemporal modeling can be done using [[relational database]]s and [[Graph database|graph databases]]. As such, bitemporal modeling is considered different from [[dimensional modeling]] and complementary to [[database normalization]]. The [[SQL:2011]] standard provides language constructs for working with bitemporal data. However, as of 2011 many of the current solutions were still vendor-specific.

== Philosophy == Bitemporal modeling uses bitemporal structures as the basic components. This results in the databases which have a consistent type of temporality for all data. One example can be to include event [[date-timestamp]] (EDTS) and load [[datestamp]] (LDS).

== Benefits of bitemporal modeling == By focusing on completeness and accuracy of data, bitemporal modeling facilitates the creation of complete audit trails of data. All data becomes immutable. Specifically this allows for queries which provide:

# The most accurate data possible as we know it now # Data as we knew it at any point in time # When and why the most accurate data we had changed

==Implementations in notable products== * [[MarkLogic]] introduced bitemporal data support in version 8.0. Time stamps for Valid and System time are stored in JSON or XML documents.<ref>{{cite web|last1=Bridgwater|first1=Adrian|title=Data Is Good, 'Bidirectionalized Bitemporal' Data Is Better|website=[[Forbes]] |url=https://www.forbes.com/sites/adrianbridgwater/2014/11/24/data-is-good-bidirectionalized-bitemporal-data-is-better/#5424ff9b567b |date=24 November 2014}}</ref> * [[TerminusDB]] is an open source document-oriented graph database that uses [[delta encoding]] and provides bitemporal functionality<ref>{{Cite web|title=terminusdb/terminusdb.pdf at dev · terminusdb/terminusdb|url=https://github.com/terminusdb/terminusdb|access-date=2021-09-12|website=GitHub|language=en}}</ref>

== See also == *[[Temporal database]]

==References== <references />

{{Data warehouse}}

[[Category:Data warehousing]] [[Category:Data modeling]] [[Category:Data modeling diagrams]] [[Category:Database normalization]]