Well is and app that I’m working my self, kind of little “startup”, basically a social network (I’m a n00b so all this is based in my opinion and experience, I have never worked on a real project before, any opinion or suggestion is welcome!)
At first time I decided to use simply Postgre for all my my project (pretty robust, amazing search features etc…), but after see this talk I decided to use graph databases because it really fist to what I’m doing and make the work easily, so I decided to use Postgre and a Graph database called Dgraph
So I begin to work on it, creating some data and make a sketch of what I want to, but I end up with this “problems”:
-
I need a way to recognize the data that I need in the two databases, so I need the same identifiers (duplicate data)
-
I’m working with Abshinte so are Graphql queries to get the data, since get relationships from Graphql queries are pretty easy, I needed a way to query the main object requested and the relationships, so I saw two options:
- Parse the Graphql query and query the relationships to graph database, after that construct a SQL query to send it into Postgres (here I think you need to join data etc so what is the point to use a graph database) and send back the data
- Save directly the same data in the Graph database and query the relationships with the requested data, and just query the basic data of the main object to Postgres database (duplicate data)
At my opinion the second option the second option was easier
-
If I wanted to use the Graph database as a search I need to add all the data that need to query the result as wanted (again duplicate data)
-
You can build cool things with Graph databases like recommendation systems and so… Need to have the same data in the two databases too to make the feature work correctly
The problem with two databases and duplicate data is maintain the same state in the two databases, so what if one fail if the other no when you update data etc…
At this point looks reasonable to me just use the Graph database, but I haven’t yet made a final decision, as mention before I’m a n00b so possibly I’m wrong on all that I said or a few things, I hope to be corrected if that is the case
Feel free to correct any grammatical problem