Key data entities are stored in LUSID bi-temporally. What does this mean, and what are the benefits of this method of data storage over more traditional transactional views?
This is a way of storing information, where each piece of data is captured with two date-time values:
- The effectiveAt: the time the piece of data is considered ‘valid’, in a business context
- The asAt: the time the data was physically recorded in LUSID
Consider a quote for a stock, for example:
- Vodafone Group PLC (VOD) @ 20 Aug 2018 10:02 UTC = 176.14 GBX
The effectiveAt for this quote is 2018-08-20 10:02:00 (UTC)
The asAt would be the time the quote was actually saved into the system. This time may be slightly later than it’s effective time, as there may be a delay in the quote being published and LUSID ingesting the data.
Whenever any data is retrieved from LUSID, the user must supply times for both the effective At and the asAt (or asAt = ‘Latest’). These times are then used to filter the universe of data, to locate the most appropriate value.
The primary benefit of storing data bi-temporally is that it allows all data changes to be recorded and audited. Consider if this quote had been saved with the wrong value. Using the bi-temporal model, we are able to correct the value retrospectively. The corrected piece of data would have the same effectiveAt as before, but the asAt time on the updated record would correspond to the time the correction was made in LUSID. Since LUSID stores both versions of the piece of data, you are able to retrieve the latest (i.e. corrected) value using asAt = 'Latest', or retrieve the original value using the asAt from the original record.
See the article on the Importance of Portfolio Creation Date for another example of the use of bi-temporality.