Ask HN: Why are relational DBs are the standard instead of graph-based DBs?
(disclaimer: I am VP of Engineering at RelationalAI where we are building a graph database that uses the relational model)<p>Thanks, this is a great question with many technical, social, and commercial aspects to it.<p>TLDR: the relational model has a super power for data management systems: it decouples the logical from the physical representation and will eventually always win. There are technical reasons why it was hard until recently to build a graph database based on the relational model.<p>Database were not always relational: In the 1960s databases actually had a navigational paradigm and used a hierarchical or network data model (not unlike some current graph databases).<p>The 1970s saw the rise of relational database management systems with early proofpoints of Ingres and System R. The important improvement here was that the physical organization of data is separated from its logical organization in relations. This is the super power of the relational model. This innovation led to an explosion of commercial activity with Oracle, DB2, Sybase (licensed to become Microsoft SQL Server) and some more. Many of these are now still industry giants.<p>The 90s was a big hype of objected-oriented programming and some got the idea that database management systems should be following the object-oriented model as well. This was mostly a catastrophic failure and instead systems based on the relational model kept improving and won in the end.<p>In the 2000s there was a large emphasis on scalability to large numbers of users and data, and the development of NoSQL systems started. Most of these did not follow the relational model. These are the key value stores, document databases etc. Key value stores addressed the problem of poor scalability but compromised on the data model and transactions. Document databases have better locality of data and made schema changes easier. They all had something in common: compromise on the relational model to gain an advantage over existing relational systems. However, systems based on the relational model kept improving the meantime and have gradually started to gain market (or mind) share again (eg Aurora, Snowflake, Spanner, CockroachDB).<p>In my opinion, graph databases are next. Graph databases identified a weakness, which in this case is modelling and the inability of <i>current</i> relational systems to handle graph structured data well. Graph data involves many joins and often recursive computations, which current commercial SQL relational systems do not do well. However, the new graph databases are not superior universally. For example, take TPC-H (OLAP - analytical) or TPC-C (OLTP - transactional), put that on a graph database and you&#x27;ll typically see pretty terrible performance even though the data can easily be modeled as a graph. Several popular graph database systems do not even scale well beyond a single node.<p>I think you are absolutely right that graph data models are easier to work with. Starting from an ER diagram (or similar) it&#x27;s not straightforward to go to tables. Assuming that your ER model is a good model, you&#x27;re grouping stuff into tables based on functional dependencies. Tables here are a collection of relations, eg for an _order_, the SQL table might include relations to the customer, order date, etc. It does not include relations to products included in the order, because these have a different primary key. This is difficult for users to understand.<p>Predictably, the relational model is catching up though with graph database systems. A major research innovation in databases from recent years are better join algorithms, specifically for joins involving many relations, self-joins and skewed data. They&#x27;re called worst-case optimal join algorithms (WCOJ) and several early prototype systems have shown promising results with these.<p>Based on these ideas, RelationalAI ( <a href="https:&#x2F;&#x2F;docs.relational.ai&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.relational.ai&#x2F;</a> , <a href="https:&#x2F;&#x2F;twitter.com&#x2F;RelationalAI" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;RelationalAI</a> ) is building a graph database management system based on the relational model. Presumably, this is the relational model utilizing its super power again and demonstrating that relational models will always win and innovate to incorporate legit limitations of previous systems.