News for hackers. Stuff that matters.
Re:What ORMs have taught me: just learn SQL (2014) by eru on Sunday December 17, 2017 @11:47PM (#15949503)
For 3: the proper abstraction for relational data is, surprise, a relation.

I used to work in an environment where we had relations as full first class data structures. They are very pleasant to work with.

We actually had 'relation-object-mappers', ie when we had to interact with other systems that didn't use relations, we often mapped them to relations internally to make them play nicer.

Re:What ORMs have taught me: just learn SQL (2014) by yorwba on Monday December 18, 2017 @12:00AM (#15949546)
How were those relations represented? If I understand correctly, you were not just wrapping tables in a database, but using some other backing implementation. What were the most common operations, and what was the performance like?
Re:What ORMs have taught me: just learn SQL (2014) by eru on Monday December 18, 2017 @12:14AM (#15949599)
Oh, the implementation was fairly straight-forward. I think just sorted arrays are something.

It wasn't about speed of execution, but expressiveness when coding. Later on they even added proper type system support.

Common operations were things like map/project, extend, filter, join, collect-by-key / expand, etc.

Just as Codd pointed out in his original papers, relations allow you to not have to make a choice about a hierarchy for your data.

Using key-value store like a hash-table in your program, or the much vaunted has-a relationship between objects would force you to make these choices. Thus making interacting with the data awkward for all but one access pattern.

Relations work best when your program is written in a style that deals largely in immutable data. (What we call 'purely functional', but people in dysfunctional languages have also picked up on the advantages recently.)

Re:What ORMs have taught me: just learn SQL (2014) by int_19h on Monday December 18, 2017 @01:00AM (#15949739)
> Just as Codd pointed out in his original papers, relations allow you to not have to make a choice about a hierarchy for your data.

Or, alternatively, make it really painful when you do actually need to query hierarchies, along the lines of "give me all the tuples above this one in the hierarchy".

Re:What ORMs have taught me: just learn SQL (2014) by eru on Tuesday December 19, 2017 @12:37AM (#15958031)
Datalog can do those kinds of queries--transitive closures--easily, if memory serves right.

Datalog is a specifically chosen subset of Prolog.