3 ms·
I don't have a number of course, but I believe that almost all relational db models are more naturally modeled as graphs. In fact, all normalized relational db
by amw-zero 5y ago
I don't have a number of course, but I believe that almost all relational db models are more naturally modeled as graphs. In fact, all normalized relational db models that use foreign keys are just implementing a graph - foreign keys represent edges between nodes.
has-many, has-one, and many-to-many are all graph relationships. The relational model + foreign keys is just one way to encode a graph.
- pphysch 5y agoYeah, tables/rows are basically vertices with 1 label & many properties*, and FKs are labeled edges without properties. But, you can easily implement edge properties with many-to-many tables, at the cost of an extra JOIN. In practice, this is a useful and efficient species of graph. I think many people get baited by Neo4j's marketing without really understanding relational models and RDBMS (I sure did). * With the (often true) assumption that many vertices will follow the same normalized schema.
- bawolff 5y agoGraphs are the least restricting data model. I think everything is easier to model as a graph, because its just things (verticies) and how they are related (edges). You mostly get to skip the modelling step. The benefit of modelling as a relational db is that it forces you to put the data in a form that's easy to work with from a computer perspective.