Skip to content

Commit f3aabd4

Browse files
committed
mpi post - fix link formatting
1 parent fd7e122 commit f3aabd4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pages/blog/bitemporal-traderx-part2.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In this follow-up post I will share some thoughts about [XTDB](https://xtdb.com)
2626
This was my first time using XTDB so I had some learning to do. Being a SQL database, most things about XTDB felt quite familiar but it still takes a little time to get used to the temporal syntax (at least you only have to learn it once!).
2727
After studying the existing TraderX data model and reading the project brief, my instinctive reaction was to start adding dedicated columns to the application's schema for handling various application and auditing timestamps like `traded_at` and `updated_at` - but what a pleasant surprise it was to find out there’s little need for many of these kinds of columns in XTDB - such timestamping is already ubiquitous and all handled under the covers.
2828

29-
The biggest surprise, however, was that because of this built-in functionality, *compared to using a traditional SQL database for recording changes and keeping old versions around, how you interact with an XTDB database remains intuitive* - at least until you need to retrieve the historical data or introduce 'retroactive' updates (e.g. when you discover some past data was incorrect and need to correct it, or when you want to backfill some missing data). Essentially, you are able to use plain INSERT, UPDATE and DELETE statements to modify data as normal, yet you are left with a fully auditable history of all changes across all records _and_ easily review past states.
29+
The biggest surprise, however, was that because of this built-in functionality, *compared to using a traditional SQL database for recording changes and keeping old versions around, how you interact with an XTDB database remains intuitive* - at least until you need to retrieve the historical data or introduce 'retroactive' updates (e.g. when you discover some past data was incorrect and need to correct it, or when you want to backfill some missing data). Essentially, you are able to use plain INSERT, UPDATE and DELETE statements to modify data as normal, yet you are left with a fully auditable history of all changes across all records _and_ can easily query past states.
3030

3131
Wait - what? History? Yes! You get all the change history for free! Not just what changed when, but a fine-grained ability to query the myriad historical database states exactly as they looked previously. For example, UPDATE statements in XTDB don’t actually overwrite old values - instead they create new entries that are carefully tracked across two time lines - 'valid time' (otherwise known as 'application time') and system time (what you can think of as wall-clock time).
3232

@@ -38,7 +38,7 @@ import sliders from '../../assets/blog/bitemporal-traderx.png'
3838

3939
<Image style="width: 100%; margin-left: auto; margin-right: auto" alt='View of TraderX showing SQL overlayed' src={sliders} />
4040

41-
Adding temporal 'sliders' to the TraderX UI was an easy way to expose XTDB's time-travel capabilities. This approach makes it efficient for users of the various blotters and dashboards to quickly observe and scrub through the changing data, compared to alternatives like having to click on some calendar widget to navigate through the history. It's a great way to understand the value that the https://en.wikipedia.org/wiki/Bitemporal_modeling[bitemporal model] can bring: just imagine any existing application with a time slider and how useful that could be for the end user - especially in domains where the end user is making important decisions based on the changing data, and you later want (or need!) to be able to reconstruct the full context behind the decision.
41+
Adding temporal 'sliders' to the TraderX UI was an easy way to expose XTDB's time-travel capabilities. This approach makes it efficient for users of the various blotters and dashboards to quickly observe and scrub through the changing data, compared to alternatives like having to click on some calendar widget to navigate through the history. It's a great way to understand the value that the [bitemporal model](https://en.wikipedia.org/wiki/Bitemporal_modeling) can bring: just imagine any existing application with a time slider and how useful that could be for the end user - especially in domains where the end user is making important decisions based on the changing data, and you later want (or need!) to be able to reconstruct the full context behind the decision.
4242

4343
Implementing this change required fetching data from multiple joined tables ‘as of’ a certain point in time. This involves a small amount of ceremony, particularly if you want to be able to control specific `valid time` or `system time` views for each table independently. However, if you don't need such detailed control, you can set the as-of time for the entire query quite easily using syntax like `SETTING DEFAULT VALID_TIME AS OF DATE '2020-01-01' ...`
4444

0 commit comments

Comments
 (0)