1

is dgraph appropriate to model real world maps (street maps, indoor maps)? Let's assume you took complete Europe as map and model it as a dgraph. Then do tasks like route calculation, spatial queries ... . Will it perform well or will another data base outperform?

Thanks.

5
  • Let us assume you want to do some routing algorithms, then you can just try it and compare to more specialized storages used in OSRM or GraphHopper (I'm one of the authors). Also have a look into Neo4J.
    – Karussell
    Commented Jan 20, 2018 at 10:16
  • I'm aware of other databases but actually I'd like to know how they compare in terms of efficiency for routing algorithms for street networks. Commented Jan 22, 2018 at 8:26
  • The more specialized the faster. From my experience neo4j was using at least 5 times the RAM and CPU compared to GraphHopper. And we speak here of normal Dijkstra algorithm, with specialized algos the difference can be easily multiplied by 50 or 100.
    – Karussell
    Commented Jan 24, 2018 at 15:54
  • What is the reason for this? Is it caused by java (dgraph may not have this overhead) or is the reason the graphdatabase? Commented Jan 25, 2018 at 8:08
  • GraphHopper is in Java too, so routing engines are just highly specialized and a graph database has to be more generic in several places
    – Karussell
    Commented Jan 26, 2018 at 9:56

2 Answers 2

3

Author of Dgraph here.

Dgraph supports geospatial index natively. That was built very early on into Dgraph. We're using similar techniques to what is used internally at Google.

It also supports k-shortest path calculations. So, yes, you could model Europe as a map, put it into Dgraph, and find [nearest restaurants], or [path from Paris to Berlin], etc. Dgraph is designed to run these use cases efficiently.

1
  • Hello Manish, is there a tutorial available for this? Commented Feb 26, 2018 at 11:47
0

You can most certainly import OpenStreetMap open data into Dgraph using the bulk loader for the initial data loading. There are functions you will make a lot of use of such as geolocation-specific functions and path queries.

I use these extensively with a graph representation of topics and terms and they are very efficient. Now, even with all of this being said, you will have to make data model design choices, e.g. favorite edges over intermediary nodes to model relationships.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.