Jayesh
Jayesh

Reputation: 1523

How to mix RDMS DB with a Graph DB

I am developing a website using Django, and PostgreSQL which would seemingly have huge amount of data as gathered in social network sites.

I need to use RDMS with SQL for tabular data for less SQL complexity and also Graph DB with Cipher for large data for high query complexity.

Please let me know how to go about this. Also please let me know whether it is feasible.

EDIT: Clarity as asked in Comments:- The database structure can be similar to that of a social network like Facebook. I've checked FB Engineering page for their open graph. For graph DB I can find only Neo4J graph DB with proper ACID values though I would prefer an open source graph DB. Graph DB structure, I require basically for summary of huge volume data pertaining to relationships like friends, updates, daily user related updates as individual relations. Horizontal Scalability is important for future up gradation to me.

I intend to use PostgreSQL for base informational data and push the relational data updates to graph DB like Facebook uses both MySql and open graph.

Upvotes: 2

Views: 444

Answers (2)

Mubeen Siddiqui
Mubeen Siddiqui

Reputation: 34

Use PostgreSQL for tabular data (profiles, posts) and Neo4j for graph data (relationships, social connections). Sync data via triggers/tasks. Optimize queries: PostgreSQL for simple, Neo4j's Cypher for complex. Scalability via sharding/replication. Cache for performance. Regularly optimize. Maintain consistency during data transfer.

Upvotes: 0

Filipe Teixeira
Filipe Teixeira

Reputation: 3565

Based on your reply to my queries. I would first suggest looking at TitanDB. I believe it fulfills many of your requirements:

  1. It is open source.
  2. It scales horizontally.

In addition to meeting your requirements it has existed for quite sometime and many companies are using it in Production. The only thing you would have to get used to is that it uses TinkerPop traversals, not Cypher queries. Also note that I believe Titan is not ACID for most backends. This is a result of it being horizontally scalable.

If you would like a more structured (but significantly less mature) approach to Graph DBs then you can look at the stack that myself and some colleagues are working on MindmapsDB which sits on top of Titan, but uses a more "sql-like" query language.

OrientDB Gremlin is also a very good option but lacks the maturity and support of Titan.

There are many other graph vendors out there such as DSE Graph, IBM Graph, etc . . . but the ones I have listed above are the opensource ones I have worked with.

Upvotes: 1

Related Questions