Combination of postgresql and neo4j for a network site

We are developing a web site where data will be connected to each other in a complex way. We plan to use Neo4j to avoid an expensive connection otherwise. Since neo4j is specifically designed for graphic data, it therefore seems appropriate.

however, we realized that although neo4j is fast in some aspect, the presentation of relational data is best done through a relational database. Thus, we plan to use neo4j for some functions and postgresql for other functions.

For example. We would use neo4j to search for appropriate channels for the user by searching through the various nodes that he follows. Although for other activities, such as updating profile information, etc., we would like to use postgresql. We did some performance testing to update profile information and found that postgresql is faster than neo4j. By analyzing feed data, neo4j is much faster.

Now my question is, has anyone used a combination of databases like this one before. In particular, neo4j with postgresql. We encounter some problems when integrating different databases, but we think it's worth it.

Share your experience and feedback. Thanks

+7
design sql database postgresql neo4j
source share
1 answer

Being that Neo4j is a graph database and PostgreSQL is a relational database, you are heading in the right direction. Many applications were developed that used the NoSQL database (including Neo4j) because of their strengths in specific applications. Other places I worked in used PostgreSQL or Oracle to store relational data and Lucene / Solr for text data, as well as MongoDB for documents.

You must clearly distinguish the responsibilities of each type of database in terms of data types.

If you make copies of data from one of them to another (for example, Neo4j data is copied to PostgreSQL for reporting purposes), make sure that you have data expiration policies or some kind of data updates that occur in a reliable and predictable way .

Finally, you may or may not want some kind of transaction concept to cross databases if one transaction includes two pieces of data, one of which is stored in Neo4J and the other in PostgreSQL, which ensures that if you can find it in PostgreSQL You MUST be able to find another part in Neo4J and vice versa.

+5
source share

All Articles