3

I am trying to understand if I should use a GraphDB for my project. I am mapping a computer network and I use NetworkX. The relationships are physical or logical adjacency (L2 and L3) . In the current incarnation my program scans the network and dumps the adjacency info in a Postgress RDB. From there I use Python to build my graphs using NetworkX.

I am trying to understand if I should change my approach and if there is any benefit in storing the info in a GaphDB. Postgress has AgensGraph which seems to be built on top of Postgress as a GraphDB overlay or addon. I don not know yet if installing this on top will make my life easier. I barely survived the migration from SQLite to Postgress :-) and to SQLAlchemy so now in not even 3 months I am reconsidering things while I can (the migration is not complete)

I could chose to use a mix but I am not sure if it makes sense to use a GraphDB. From what I understand these has advantages as not needing a schema (which helps a lot for a DB newbie like me)

I am also wondering if NetworkX (Python librayr) and GraphDB overlap in any way. As far as I understand these things NetworkX could be instrumental in analyzing the topology of the graph while GraphDB is mainly used to query the data stored in the DB. Do they overlap in anyway? Can they be used together?

MiniMe
  • 1,057
  • 4
  • 22
  • 47

1 Answers1

9

TLDR: Use Neo4j or OrientDB to store data and networkx for processing it (if you need complicated algorithms). It will be the best solution.


I strongly don't recommend you to use GraphDB for your purposes. GraphDB is based on RDF that is used for semantic web and common knowledge storage. It is not supposed to be used with problems like yours. There are many graph databases that will fit to you much better. I can recommend Neo4j (the most popular graph database, as you can see; free, but non-open-source) or OrientDB (the most popular open-source graph database).

I used graph database when I had a similar problem (but I used HP UCMDB, that is corporate software and is not free). It was really MUCH better than average relational DBs. So the idea of graph database usage is good and it fits to this kind of problems naturally.

I am not sure you really need networkx to analyze the graph (you can use graph query languages to it), but if you want, you can load the data from your DB to networkx with GraphML or some another methods (OrientDB is similar) to process it using networkx.

And the little question-answer quiz in the end:

As far as I understand these things NetworkX could be instrumental in analyzing the topology of the graph

Absolutely right.

while GraphDB is mainly used to query the data stored in the DB.

It is a database. And, yes, it is mainly used to query the data.

Do they overlap in anyway?

They are both about graphs. Of course they overlap :)

Can they be used together?

Yes, they can. No, they should not be used together for your problem.

vurmux
  • 9,420
  • 3
  • 25
  • 45
  • Very comprehensive answer, exactly what I needed. Graph DB is just referring to this category of databases not the a certain GraphDB product. I am inclined to use Neo4j because of a very powerful browser which will save me work with publishing the maps of the network or create new ones. What did you use to visualize the info. To me it seems very convenient to use the browser and publish the queries or teach my colleagues how to query it...then I do not need to write code to create maps – MiniMe Mar 27 '19 at 16:12
  • I visualize graphs with Gephi or Graphviz/DOT (depends of graph types) because I mostly work with graphs offline on my local machines. But, as I remember, Neo4j has pretty good graph visualizer inside browsers (not sure about OrientDB, I think it has not). I have another answer with short explanation about it (look at PS): https://stackoverflow.com/a/55377218/11227781 – vurmux Mar 27 '19 at 16:22
  • Graphwiz is what I started to but it is too ...static. I wanted an interactive graph with options to filter nodes move them around and so on. Yes that Neo4j browser looks like what I need. I did look and Gephi and others like it but they seemed too complicated – MiniMe Mar 27 '19 at 16:50
  • I can't say Gephi is very complicated. It is powerful and you can not to use all its power, if you don't want (like, hmmm... Photoshop comparing to Paint). Anyway, it has many features that can help you, like filtering, dynamic coloring, finding giant components, automatic clustering, various layouts etc. Moreover, you can visually move nodes (unlike Graphviz). I suggest you to give to Gephi one more chance :) – vurmux Mar 27 '19 at 17:02
  • OK I will try gephi but I need to feed Gephi with data. What I need is what the browser offers, the user accesses that page he or she runs the query it needs and there you go the graph is there. For more elaborated things and static I am considering D3 – MiniMe Mar 27 '19 at 19:47