COMAND Temporal Storage
Temporal Storage (also known as a temporal database) enables the storage of the state of a content record as it evolves over time. When a content record is created, and each time any of its fields are modified, the new state is captured and can remain in the storage, along with the time it was changed.
Relational Storage
In a relational storage engine, each version of a content record and all of its data type field values are stored in a row in the content type table. Each version of a relationship field is stored in a row in the content reference table. In both cases, the row maintains a start and end timestamp that represents when the represented state came into existence and when it changed.
Content Type Table
For the definition of all content type table columns, see Relational Database Content. With the introduction of temporal storage, the _LastModified column is replaced by _StartTime and _EndTime.
- _ActiveID - Negative ID whose absolute value is the ID of the active content record this row represents at a previous point in time. The negative number indicates a past version of the content.
- _StartTime - Timestamp for when the content record entered the state represented by this row, and was created or changed. This column will store a zero timestamp when the start time is not known (ie. it was created before temporal storage was introduced).
- _EndTime - Timestamp for when the content record exited the state represented by this row, and was changed or removed. This column will store a zero timestamp when it represents the active object.
Below is an example content type table for Contact content.
ID | _FieldID | _ParentType | _ParentID | _AciveID | _StartTime | _EndTime | OID | UUID | Name | DOB |
---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | 0 | 0 | 0 | 2013-12-31 12:21:30 | 0000-00-00 00:00:00 | 123 | ... | John Smith | 1975-12-03 |
2 | 0 | 0 | 0 | -1 | 2013-12-14 01:21:30 | 2013-12-31 12:21:30 | 123 | ... | John | 1975-12-03 |
3 | 0 | 0 | 0 | 0 | 2013-12-11 01:21:30 | 0000-00-00 00:00:00 | 123 | ... | Mary | 1975-11-02 |
Content Reference Table
For the definition of all content type table columns, see Relational Database References.
- StartTime - Timestamp for when the content reference represented by this row was created or updated. A zero timestamp means that the time the reference was created was before temporal storage was enabled.
- EndTime - Timestamp for when the content reference represented by this row was changed or removed. A zero timestamp means that the reference is currently active.
Below is an example content reference table for Contact content relationships. Field ID 204 represents the "Friend" field within a contact. Contact is has a content type ID of 53.
ID | ParentFieldID | ParentType | ParentID | ChildType | ChildID | OrderIndex | StartTime | EndTime |
---|---|---|---|---|---|---|---|---|
1 | 204 | 53 | 1 | 53 | 3 | 0 | 2013-12-16 01:21:30 | 0000-00-00 00:00:00 |
2 | 204 | 53 | 3 | 53 | 1 | 0 | 2013-12-16 02:21:30 | 0000-00-00 00:00:00 |