xtdb

Panel 2025-01-14T04:51:02.664129Z

How can I ensure that the data I pulled hasn’t changed when I compute new information and save it back?

refset 2025-01-14T10:19:13.108859Z

even more specifically, if you're only transacting 'current' data, you can quite simply validate that the _system_from is what you expect and that the _system_to of the record you're trying to change is still NULL/`nil` (otherwise your ASSERT needs to repeat the data itself or rely on some other versioning pattern)

Panel 2025-01-14T10:37:19.103059Z

Here we go this is an example of bitemporality used out of the box 😆 But I'm not sure I understand how this works; when you pull data to your app, you also grab some system time that you compare back when you transact some new data to make sure it's the same?

🙂 1
refset 2025-01-14T12:55:44.897569Z

Yep, essentially it's the same pattern as a 'CAS', but you can avoid re-sending the whole original value

Hukka 2025-01-14T07:45:58.521579Z

Transactions with asserts

✅ 1
Panel 2025-01-14T07:46:46.653389Z

Thanks