10 ms·
Why Are There No Relational DBMSs? [pdf] (2015)
- deleted 4y ago[deleted]
- boogerlad 4y agoThere are: https://github.com/agentm/project-m36 https://github.com/agentm/project-m36
- gnufx 4y agoI don't know specifically how Dated it is, but https://people.csail.mit.edu/jaffer/slib/Relational-Database.html https://people.csail.mit.edu/jaffer/slib/Relational-Database... might also be of interest.
- jameshart 4y ago> how Dated it is Is this… a Chris Date pun? You should have said it “Codd also be of interest”.
- eternalban 4y agoFinally, Chris Date's name is mentioned in this thread. It was curious that the Darwen's pdf mentions him in asides. Did they have a falling out? https://cs.stackexchange.com/questions/99350/did-date-and-darwens-third-manifesto-have-a-lasting-impact https://cs.stackexchange.com/questions/99350/did-date-and-da...
- bob1029 4y agoFunny coincidence. I just picked up Database in Depth from AbeBooks a week ago... ChatGPT brought his book up in a fever dream QA session regarding database normalization and I figured I'd give it a look.
- emmelaich 4y agoHe is listed in the acknowledgements ... > ... Chris Date saw early drafts and suggested several improvements.
- eternalban 4y agoAh. Thanks, didn't see that.
- pasc1878 4y agoAlso mentioned in the paper as producing a corresponding paper at the same time.
- jameshart 4y agoFor the benefit of those looking to understand the premise of the question, The author’s complaints as to why SQL-based DBMSs are not ‘truly relational’ are enumerated as follows: > Why did they neglect the obvious need for each of a table’s columns to have a name? Why did they allow a table to have two or more columns with the same name? Why did they decide to allow more than one copy of the same row to appear in a table? Why did they invent NULL and introduce that third truth value, UNKNOWN? Where by ‘table’ he means ‘result of a query’. So the complaint amounts to SQLs failure to fully ‘close’ such that the result of any query would automatically be an indexed relation exactly equivalent in capability to a table. Which I guess is something every SQL user has run into from time to time, and is a source of annoyance, but doesn’t seem to have prevented people from actually using SQL to… manage… relational data. Also, much of this paper seems to be taken up with complaining that Codd didn’t think through all the details someone would need to iron out when actually implementing relational calculus, which seems like an odd place to lay the complaint. Codd demonstrated that a system based on relations was, in certain ways, complete and comprehensive (ie it could let you answer ‘any question’ about some data); that it didn’t also serve as an unambiguous spec for how to design a query language and engine seems to ask a bit much of the initial theoretical underpinnings of the entire field. Like complaining that Turing’s paper on universal computation doesn’t actually nail down how to design a CPU.
- TrispusAttucks 4y agoI'm pretty sure you can load a query result into an [1] in memory table and query that including generated indexes. [1] https://dev.mysql.com/doc/refman/8.0/en/memory-storage-engine.html https://dev.mysql.com/doc/refman/8.0/en/memory-storage-engin...
- msla 4y ago> Why did they invent NULL and introduce that third truth value, UNKNOWN? I fundamentally don't understand how you can have all of the kinds of JOINs SQL has without a NULL.
- maxdemarzi 4y agoYou can by using “narrow” tables (key value and key key). Download the slide notes from this presentation of how Relational.ai is doing it: https://www.slideshare.net/maxdemarzi/developer-intro-deckpowerpoint https://www.slideshare.net/maxdemarzi/developer-intro-deckpo...
- pestatije 4y agohttps://en.wikipedia.org/wiki/Relational_database#RDBMS https://en.wikipedia.org/wiki/Relational_database#RDBMS
- codeulike 4y agoSQL is a wildly successful invention from nearly 50 years ago that remains extremely relevant today - whatever sort of coder you are, you're probably going to use it at some point. And if you get beyond the surface level SQL stuff, you'll probably still find it pretty impressive in its expressiveness, despite its age. Is there anything else programming-wise from the 70s thats still as relevant today? The OP paper is interesting but the complaint that SQL is not 'pure' enough reminds me of Project Xanadu's vision of 'pure' hypertext. https://en.wikipedia.org/wiki/Project_Xanadu https://en.wikipedia.org/wiki/Project_Xanadu HTML won out over something like Xanadu and SQL won out over the 'pure relational algebra' language we never got because making practical compromises is very important. My take away: Designing something with the right mix of principled design and practical shortcuts around those principles is more important than just rigidly sticking to principles.
- jakebasile 4y ago> Is there anything else programming-wise from the 70s thats still as relevant today? Lisp is still relevant (for some definitions of relevant [I work in Clojure so it's very relevant for me]) and it's from 1960.
- divan 4y agoI switched to EdgeDB couple of years ago, and after writing EdgeQL I never ever want to go back to writing SQL queries again. SQL now feels very unexpressive and clumsy, but I didn't have that feeling before I had a chance to compare it on practice. Also, "HTML won" not because it made practical compromises, but because it was literally the only first-class option available in the browser, and as web platform has exploded everyone wanted to move to the web, so they had no other choice but to build their tools and products with what they got.
- mrits 4y agoWhat specifically do you like about EdgeQL? From my experience it seems to be only popular with people that don't ever care about the actual query plans and calculus underneath.
- fbn79 4y agoMay interest you https://www.dbdebunk.com/ https://www.dbdebunk.com/
- bigbillheck 4y agoI poked around this site and it's mostly Fabian Pascal ranting about how everybody else is doing things wrong and are also idiots.
- hgsgm 4y agoPascal is Codd&Date's unwanted overeager hype man. I appreciate that he cares, and he is smart, but he needs someone to make him presentable.
- vaughan 4y agoI've come to believe that relational is the wrong choice for most apps. Most people choose a relational db without even realizing what relational means and what the tradeoffs are. Almost every app dev would prefer that their app reacts to changes in the entities, and updates it UI accordingly. Incrementally computing new query results. This is non-trivial in the relational model. The relational model is a bunch of constraints such that relational algebra can be used by the system to re-arrange the query plan and get the same results. Your queries are optimized, yes, but if you want to stream changes, then you probably want a different query plan altogether. And its not a matter of just making SQL cacheable and streamable like with incremental view maintenance - you probably want different queries to run altogether. Most people aren't building analytical reporting apps with SQL. The database size for a single user or team in most apps is such a small size that aggregations can just be done client-side even. I think a better way would be to have a database that knows about all queries in your app, and optimizes collectively. And instead of relying on the database to do it, give users the tools to build query plans themselves. And also, throw away the idea of relations and just make all query results reference the underlying entities. Instead of complaining about the "ORM mismatch" with relations, get rid of the relations, and embrace objects.
- klysm 4y ago> have a database that knows about all queries in your app, and optimizes collectively I’ve had this idea floating around in my head for a while: if you could take all the queries and the schema, you should be able to compile that to a specialized binary that only does those queries. I have no idea how to accomplish that but I bet you could do a lot of nifty optimization. Migrations get hard but I wonder how good it would be
- vaughan 4y agoMakes me think of the current frontend trend of compiled reactive ui frameworks like Svelte. Also the SQLite bytecode engine. https://www.sqlite.org/opcode.html https://www.sqlite.org/opcode.html
- 4y ago
- Pxtl 4y agoHappy to hear Darwen dislikes 3-value logic. A language where x=x can return something equivalent to false in a common use-case is wrong.
- pphysch 4y agoActually, systems that don't crutch on the "Law of Excluded Middle" are more robust and realistic than ones that do.
- skissane 4y ago> A language where x=x can return something equivalent to false in a common use-case is wrong. Then almost all common languages are wrong, if you consider floating point NaNs to be a “common use-case” - and surely they must be, since it is easy to produce them using ordinary arithmetic operations.
- Pxtl 4y agoMaybe you do different programming from me but I find NULLs far more common than NaNs.
- skissane 4y agoAt my day-job, I almost never use floating point, so NaNs don’t come up. The one exception to that is JavaScript, where NaNs pop up significantly more than in most other languages - parseInt() will return a NaN if you give it an invalid number, most other languages a function called “parseInt” wouldn’t return floating point. I work on a lot of code that uses SQL NULLs, but most of the time I don’t encounter them directly, because I’m using some ORM which translates them to Java nulls (or Go nil or whatever), and many query generation frameworks handle the weirdness around querying for nulls (IS NULL vs = NULL) automatically. Most programming languages don’t give their nulls the weird equality semantics that SQL nulls have
- Pxtl 4y ago> The one exception to that is JavaScript, where NaNs pop up significantly more than in most other languages - parseInt() will return a NaN if you give it an invalid number, most other languages a function called “parseInt” wouldn’t return floating point. Ahh, every time this conversation about how SQL Nulls violate reflexive property of equality, people are like "so do NaNs" and I'm wondering "who are these people who are dealing with NaNs all the time?". I'm mostly a back-end and DevOps guy, so I don't write that much JS. I didn't know that JS used NaN the way other languages would use Null or exceptions for numerical operations. ... Also that's terrible.
- dboreham 4y agoThis is an example of a general (imho) fallacy pattern that also shows up with FP: There's some branch of mathematics. Some people become familiar with that and like it for psychological reasons. Makes them feel good that they grokked it. Now, some subset of those people end up in positions where they can write software and academic papers. They notice that some problem space relevant to computing is kind of like that branch of mathematics they liked. They embark on a zealous mission to apply that branch of mathematics strictly in the context of the problem space. Reason I think this is a fallacy is that there's nothing god-given about some branch of mathematics that makes it somehow pristine and golden and "better" than some adhoc solution hacked together by a hacker. Mathematics was also "hacked together", just it was done before computers existed. So these people are really on a kind of circular journey -- they're taking someone's definition of a VM that is called Mathematics, that typically was derived from ordinary principles present in the natural world, and having the bright idea that they can implement that VM in code and that they will be much more "proper" than if someone else had instead begun with those same ordinary principles and gone straight to software. Put another way: SQL doesn't need relational algebra. You could just as well derived relational algebra from SQL than the other way around. They both come from the ordinary need to filter and reason about collections of records about things.
- randomdata 4y agoTradeoffs were made, as always. Although it is fun to remind people that since SQL isn't relational that SQL databases are NoSQL databases.
- goto11 4y agoThe problem with SQL is it is based on relational algebra, just not consistently. SQL allows you to insert a duplicate row or update a row such that it becomes similar to another row. But then it is not possible to delete or change the row again without changing or deleting all the duplicates, because the query language assumes rows are unique. This is obviously a footgun and not useful behavior.
- gweinberg 4y ago
- skissane 4y agoSQL’s syntax is really ugly, and rather obviously inspired by COBOL-unsurprising for something invented by IBM in the 1970s, and which was developed on IBM mainframes. Yet so many people who think poorly of COBOL’s syntax don’t apply the same judgement to its offspring SQL.
- klysm 4y agoI don't know of anybody that actually _likes_ SQL's syntax, it's just that the value of it being mostly universal exceeds the syntactic downsides.
- deleted 4y ago[deleted]
- andrewflnr 4y agoTo the extent SQL gets a pass, it's because it packs a lot more power in that ugly syntax than cobol does.
- hgsgm 4y agoWe have Stockholm Syndrome because we don't have modern languages to replace it. (except ORMs, which address some issues, but not the big relational ideas) No one thinks SQL is the best possible way to write a query. It takes challenging but elegant ideas about sets, and express them in a language that demos well in the shop window, but obfuscates and interferes in non-toy queries.
- colonwqbang 4y agoSQL syntax is awful, but I do think many SQL programmers are aware of that. One problem is that the SQL standard is very loosely followed by implementors, so the syntax and semantics of each implementation can be wildly different. For instance, major implementations do not agree on if double quotes denote string literals or identifiers. "test" is either the literal string "test" or it is (e.g.) the value of the column called "test'. I think this contributes in part to the difficulty of writing down a revised language to replace SQL. Compare this to e.g. the C language, standardised at roughly the same time as SQL. In C implementations there is much stronger agreement about what the language looks like. I'm not sure why this is the case.
- paulddraper 4y agotl;dr The chief complaint is that SQL DBMSs support more features than a strict relational model, though you don't have to use those features. 1. Column names. SQL is very flexible so you can do things like SELECT * from joined tables. Perhaps a bit sloppy, but not bizarre IMO. 2. NULL. This is purely a performance optimization. You can have a optional foreign key to another table, without introducing an entirely new table. 3. ISBL and BS12 were obscure and had proprietary IBM baggage. If you want to use a SQL DBMS will unique column name and no NULL, you can. If I were going to write an article, I would include a legit deficiency, like no convenient anti-join.