Data Patterns for Changing Data

I am considering using datalog as a database for the application that I am writing because I see a potential that allows me to easily switch between views without having to sacrifice my collected data or write cumbersome migration.

However, I cannot foresee how I will deal with data changes - for example, something as simple as a removable password. I had the idea to mark the lines with a date:

changepassword(<user>, <passhash>, <date>) 

and then use the latest version, but there seems to be no way to get the latest version without returning all the rows and filtering them on the application side.

How are data logging applications designed to handle changing data?

+6
source share
1 answer

If you look at http://c2.com/cgi/wiki?QueryLanguageComparison , you will see that Datalog is not able to perform aggregation, min, max, top N, etc. Due to transitional relationships and recursive queries.

Essentially, you will need to do some kind of aggregation, etc. at the application level, which is far from ideal.

However, there is at least one product (which I must admit that I have not used or studied the details) that extends the Datalog syntax for these cases: Datomic , find the "Units that return a single value" section.

+3
source

Source: https://habr.com/ru/post/952036/


All Articles