[BLOG] Building a bitemporal index, part 2: Bitemporal Resolution #4453
Replies: 1 comment 6 replies
-
|
Very interesting read, thank you! I'm interested in how users of xtdb manage to (efficiently) find an upper bound for "valid time" for the append-only log when "out of order" data is considered. To follow your example, let's say I had a data source reporting some "version" as it changes over time (a "snapshot" of the value at specific times). All we receive from the source is the version and the timestamp at which that version was checked and reported to be valid. I'd imagine the "sensor data" use-case described in Part 3 would have similar data.
Meaning we know that the thing was at version 1 at T1, and version 3 at T3. In your append only log, it sounds like we might see
But now at T4 we receive the data
My confusion is that this measurement makes no claim as to its validity period. The measurement taken at T2 should be "valid" until the next measurement. So the below log is not correct.
Instead, version 2 should have a valid range of T2 → T3 only. Which means it needs to be inserted with a There's certainly nothing stopping us from looking up what this upper-bound should be at insert time. But now this temporal-aware logic is pushed into the application. And if I'm writing a batch of data, I now have to search both within the batch as well as within the data on disk to find what I'd love to hear your thoughts on this - is there a way that my application wouldn't have to be aware of such cases, and could just blindly insert the data without any reads? Have I misunderstood something here? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I hereby coin "Henderson's Tenth Law":
(with apologies to Greenspun, obviously)
In this blog, we dive into the heart of XTDB's temporal engine, and understand the performance and efficiency gains you get when your database fundamentally understands how real-life data behaves over time, rather than trying to replicate the same in a traditional SQL database, using extra columns, history tables, triggers, etc etc.
https://xtdb.com/blog/building-a-bitemp-index-2-resolution
For part 1 - a pragmatic tour of how data tends to behave over time - see #4399
Cheers,
James
Beta Was this translation helpful? Give feedback.
All reactions