by smartmic · 2y ago · 0 comments
> Looking back it seems such a simple idea to replace the hierarchical structures used to build databases with tables of rows and columns
> First of all, XML structures are fundamentally hierarchic; thus, all of the intrinsic difficulties with hierarchies that we experienced all those years ago-with IBM’s IMS product in particular-are rearing their ugly head again.
What I mean: the relational model has replaced existing hierarchical models. Isn't that proof by practice that the underlying mathematical model (set theory, predicate logic) is extraordinarily well suited to cover data structuring and information modeling in computer science. And, yes, hierarchies are also first-class citizens in relational models and can scale beautiful.
Even the developments, yes, "hypes" of recent years and decades such as NoSQL or knowledge graphs and graph databases have not fundamentally shaken this, but we are increasingly seeing a return to the proven relational model. Hence "history repeating".
Maybe. Maybe not. The only practical example we keep seeing is implementations centred around SQL which, while loosely based on the relational model, notably does not have relations. Without relations – the idea that sits at the very core of the relational model – you don't technically have a relational database (even if we colloquially call it as such).
So while, in theory, the relational model should work just as well, practice hasn't attempted to prove that at scale. Not since Postgres was first created has anyone really even tried to implement the relational model, and Postgres soon gave up on the idea and moved to SQL too. It may be that tables are actually better for practical use and that the relational model would fall down flat if we ever gave it a serious go.
But the relational model works and has been proven, independent of SQL.
Hell, even Datomic.
I think most people would say that C doesn't have message passing. Being able to use the facilities provided by the language ecosystem to build message passing / relations on top is at another level.
Subset. You can build relations on top of tables, but not tables on top of relations. SQL falls short of the mathematical model. As it pertains to the topic at hand, whether or not that is significant is not something we have tried very hard to prove in practice.
A Table is a Relation encoded as a set of tuples resulting from the cartesian product of values from multiple sets each of which is from a domain.
Tables are a weaker form of Relations and hence a superset except for the "ordering" characteristic when it can be considered a subset.
I would love it if you could add some practical example.
Basically, SQL does not constrain one to a strict mathematical relational model since you can have ordering, duplicates, nulls etc.