Fork me on GitHub
#datomic
<
2024-04-08
>
miwal16:04:54

hi there, has anyone read any good academic work on EAV, comparing it to SQL? There are a tonne of stack overflow questions on this, but to my mind this comparison is worthy of a more sustained and thorough (definitive? formal?) treatment. Also to note, this question has been posable for decades, it's not new, such papers are likely of some vintage.

Joe Lane16:04:03

Search for RDF Triple Stores instead of EAV and you should get lots of academic research

ghaskins16:04:30

@U0CJ19XAM my thought exactly. @U013RDDF9HT IIRC, datomic was inspired by RDF so you will see many parallels. One note, RDF uses “subject predicate object (SPO)” nomenclature rather than EAV, but they are interchangeable in this context.

refset16:04:34

I recommend starting with "https://en.wikipedia.org/wiki/Sixth_normal_form" - particularly anything by Date/Darwen. 6NF covers the most of the essential EAV ideas: 1. avoiding nulls 2. accounting for temporal changes 3. vertically decomposed binary relations (i.e. a table per data column) e.g. see links here https://dba.stackexchange.com/questions/8994/6th-normal-form-recomposition-query-efficient-implementation Digging into RDF works too, just bear in mind that RDF has an "open-world assumption"

plexus06:04:44

This would be a good topic for #CJ322KHNX

miwal10:04:50

Thanks for the replies, but in retrospect I now think my question may contain a conceptual error. I now believe SQL (relational modelling) and EAV (triple stores) may not be suitable for direct comparison, because they exist at different levels of abstraction. Relational modelling can be implemented using a triple store as the base. That in fact is how I use datomic. The challenge has been gaining clarity on which features of datomic I don't need and shouldn't be using, to attain engineering convention/discipline.

miwal10:04:50

:cardinality/many relations would be one example...

miwal10:04:40

a concerning realisation: this may make datomic harder to talk about, because different people may have completely different data modelling approaches!