It's definitely "heavier" than it needs to be – we store a lot of redundant data, but it hasn't been a huge issue.
But we have tools that build the tables/views, and generate sqlalchemy code, so that it's not difficult to manage, all told.
Our implementation is based on GIST with exclusion, and we have it in production for over a year by now. Zero performance problems, lots of gains from the business perspective.
Our code is here: https://github.com/scalegenius/pg_bitemporal
Another totally valid complaint of our implementation is that it makes Schema migrations a major pain. I wasn’t around when we made our extension, but if I had been, I probably would have recommended using yours :). I suspect that we did it our way because it was some combination of (1) the most straightforward to migrate our existing data towards (2) it was the easiest to hack together.
Anyways, thank you for sharing your project! I’m excited to use it at home, and maybe in the future at work!
- What was X's address 2 years ago?
- What did our database think X's address was 2 years ago, 3 months ago?
It's fundamentally impossible to answer those kinds of queries in a scalable way (parsing application logs is not a scalable way) without bi-temporal data.
I'd readily acknowledge that there are some types of data, for which having the capability to answer those queries is overkill. But, in the insurance industry, this kind of introspection is essential from both a compliance and correctness point of view.
Personally, if I were an auditor/government regulator for this industry, I would raise a big red flag over any critical data that wasn't bitemporal.
I would definitely vouch for its business necessity – so please, keep up your advocacy!! :)
We have a few custom tools to make them more ergonomic to create and update, but the core functionality is derived from an open source extension, I believe. Although, googling for it now, while away from my work computer, I can’t seem to find it... :/
... after looking it up on my work computer, it turns out we wrote our own implementation. It’s less than 200 lines of SQL, and uses three relatively common extensions. I wish it was open source, because it’d be super helpful to have in the future. But hey, at least it’s good to know that it can be/has been practically done?