7

I am confused between using a generic graph database (neo4j) to mongodb for tracking gps devices.

Functionality I require :

  • Track and profile the path of each tracked device.
  • Lat long / address based searching for devices
  • Traffic estimation based on aggregated data from all devices
  • Some more intelligent stuff for which I will implement the algorithms.
  • Should have a stable interface to Nodejs

Any suggestions ?

Some answers here suggest to use a GIS database, some suggest graph , Can someone clarify the difference ?

NoSQL and spatial data

Community
  • 1
  • 1
srinathhs
  • 1,998
  • 4
  • 19
  • 33
  • Typically, if you are going to be doing a lot of aggregation, an SQL database is the way to go. However, DBs such as Mongo and what not have come along way in this respect. The fact is, given your list, it is hard to make a decision either way. It's easy enough to fire up MySQL and do everything you need here, efficiently. Without knowing more specifics, it is hard to suggest something. – Brad Jun 20 '12 at 05:05
  • @brad : Some of the stuff above are as you said easy to do in mysql (the tracking part), for the rest I will need some complicated queries like "get all available drivers in this location ready to go to location b sort them based on their rating and who takes less time" – srinathhs Jun 20 '12 at 05:11
  • Well, the first part of that query is a piece of cake. For the "who takes less time" part, I assume you're going to implement a path-finding algorithm. You're probably going to do that on the application side anyway. – Brad Jun 20 '12 at 05:13
  • 1
    The "who takes less time" will be a combination of "drivers individual average speeds" "current traffic conditions" "finding the best route", I am more concerned of how will it scale when using mysql and tracking > 5000 devices and each device updates itself every 10 sec. – srinathhs Jun 20 '12 at 05:17
  • 1
    Yes, I would be concerned too. Scaling things up like that requires experimentation with your specific circumstances. You're likely going to spend most of your time on figuring out how to distribute this problem across multiple servers. In any case, the solution is very specific to your problem. You will have to experiment with your specific needs and code. – Brad Jun 20 '12 at 05:36

3 Answers3

3

I would suggest an object relational database as opposed to a no-sql database such as mongo, because it sounds like your data analysis will be utilizing a lot of the relational features that mongo excludes.

Per your specifications I would suggest PostgreSQL with the PostGis plugin. PostGIS is a spatial database add-on for the PostgreSQL relational database server. It includes support for all of the functions and objects defined in the OpenGIS “Simple Features for SQL” specification. Using the many spatial functions in PostGIS, it is possible to do advanced spatial processing and querying entirely at the SQL command-line.

just eric
  • 927
  • 1
  • 11
  • 23
3

You might want to have a look at geocouch extension for couchdb which supports spacial information along with bounding box queries. Obviously, you can add you're own views with map reduce functions for your specific use cases.

My use case was a bit different but involved storing GPS coordinate every 5 minutes for a duration of about 3 weeks almost none stop over 6000 Km. I had custom views to compute distances, mean speed, etc along with list function to output itineraries in KML format and such. A web interface was also provided to track the current location in real-time. No problem whatsoever with CouchDB.

As for a client library for node, I've been using cradle for some projects and I'm pleased with the stability and easy of use. Just make sure you're not caching in development while changing the views and all.

pdeschen
  • 1,369
  • 15
  • 17
3

Considering the specific implementation decided to go with mongodb + postgis configuration.

srinathhs
  • 1,998
  • 4
  • 19
  • 33