-2

I want to ask a question about graph database.

First im using networkx in python and creating graph in memory, but when i reach more nodes - my RAM was not enough.

So, for next time i try to neo4j. Its nice, write graph on disk, but its slow(how i think. With index and other things, more slow than networkx). Now i create 500k nodes and 2000000 relationships, try to find path between two nodes, and neo4j just stuck on my server.

I hear about orientdb, but not try yet now.

So, i need advice, what the best graph database, who can write graph on disk?

Big thanks to you.

PS want only open-source graph database

Bierbarbar
  • 1,399
  • 15
  • 35
  • With graph databases in particular, your modeling and queries are going to make the biggest differences when it comes to performance. If you are serious about considering each of these graph dbs, you will need to spend some time getting to know the query language and modeling recommendations. I'd advise you to take advantage of each db's respective community for modeling advice and ensuring your queries are optimized. A poorly tuned query or an inefficient model will ruin performance, so you need to make sure you're using your tools properly, regardless of db. – InverseFalcon Apr 04 '19 at 21:06
  • @InverseFalcon my code is very simple. Like this https://stackoverflow.com/questions/55493547/why-allshortestpath-so-slow (neo4j). I just creating some nodes, after i create large count of relationships. And ending of this - show path between some two nodes. So, in networkx i doing just add_node and add_edge in while, and running shortest path function. And its very fast, much faster than neo4j with recommendation from cybersam in my last thread on stackoverflow. – vasyavasily Apr 04 '19 at 21:33
  • We would still want the PROFILE plan of your query, if you can please add (with all elements expanded) that so we can see what's going on in the execution. – InverseFalcon Apr 04 '19 at 21:48

2 Answers2

0

First of all there are real or native graph databases or non native graph databases. The native graph databases really organize your data in a graph structure and connect the nodes to each other, while the non native are using some kind of model to store your graph representation. You can simply represent a graph as Adjacency matrix which is a table and you maybe could be stored in a row key store with columns (but that wouldn't be very effective and stupid in my opinion). So you first need to ask yourself if you really need a graph database? Second you need to think about the operations read und write you want to perform.

There is not best (graph) database. But there are many different databases for many different use cases - so you need to identify your exact use case and than you can think about the database.

For your tries with neo4j: Writing in neo4j is indeed very slow if you do it wrong. May you like to have a look at this question and answer about write performance of neo4j.

Bierbarbar
  • 1,399
  • 15
  • 35
0

Almost all graph database can write graph on disk. But if you're doing some calculation, such as shortest path for very deep search (dozens hop), memory is much much more important than disk.

min.wu
  • 19
  • 3