commontoolsinc / synopsys

datastore service for datums
2 stars 1 forks source link

🤔 Transactions info affecting triples isn't ideal #30

Open Gozala opened 4 weeks ago

Gozala commented 4 weeks ago

Right now facts are stored as quads of [entity, attribute, value, transaction] this has a negative implications, namely asserting same relation bunch of times would end up writing more records.

Alternative approach might be to remove transaction from the quad and instead write separate relations for the transaction, specifically something like

[transaction, "db/assert", assertion]
[transaction, "db/retract", retraction]
....

This would still make it possible to lookup transactions for individual facts. But asserting same fact would not create more entries.

Gozala commented 4 weeks ago

After taking another look at the current implementation, it looks like we don't actually aggregate facts we simply override them, which is even worse and not what was intended 😅