Codementor Events

Graph databases and natural languages

Published Apr 30, 2020Last updated Feb 27, 2021
Graph databases and natural languages

After working with traditional SQL database systems, after a few iterations of modeling most people understand that in order to design a system correctly, you need to make good decisions concerning information architecture. Creating the right boxes where your data will comfortably lie in.

You take out your pen and paper and start drawing out the Entity-Relationship diagram, splitting up reality into manageable chunks. The users table, the orders table, the products table. Then you start figuring out the relationships. One-to-many, many-to-one, many-to-many and so on.

Modelling a system, is merely the process of modelling a portion of reality. You decide on the boundaries of each entity and then add the right relationship keys in order to interrelate the data.

In graph databases, things seem to be a little bit simpler conceptually. And the reason why is that the way you model graph databases resembles natural language. It is very easy to match a sentence of the form Subject-Verb-Object to a Entity-Relationship-Entity graph model. A user has placed a few orders (Users->placed->Order). A product has many photographs (Product->has->Photographs).

When designing a database schema on paper, you negotiate with yourself and your sketch book through a natural language. If it is possible to be able to transfer your thoughts without changing much, that should make the designing and the developing process very human centric, and thus, a lot easier to reason about, reducing development costs and improving quality.

Discover and read more posts from Aris Lafkas
get started
post commentsBe the first to share your opinion
Show more replies