Search code examples
androidnode.jssocket.iogeolocationrethinkdb

how to setup realtime geolocation tracking in nodejs and android


Hi I want to setup realtime geolocation tracking for Android devices. This will peak to around 500 devices running app in foreground at a given time sending data to the server (average around 5-10 devices at any given time). This will be similar to what Uber does for tracking device.

I know SocketIO can be used to connect to such server but I'm not sure how to handle such data on server. I have heard node.js is good for such case but I haven't found an implementation of it anywhere. Also what kind of data store can be used in node.js to support this. Can RethinkDB be used for such implementation?


Solution

  • I have done exactly what you are trying to do, the only difference is that for time constrains I have used phonegap for the client side, however if you are using Socket.io it should be the same concept.

    As far as scalability the project is currently running on 100 devices at a time, each device updating the location as fast as every 5 seconds and as slow as 1 minute depending on if is moving or not (in normal conditions).

    On the server side is running nodeJs server to process the information, the data is received as raw GPS data and I am using googlemaps to get the approximate direction and the current prefecture (for filtering purposes).

    The data is the both saved into a mysql DB using mysql and pushed to a admin pc to display the location on google maps in real time.

    the only potential problem you can have scaling is the amount of data that is been stored into the DB but is nothing that clearing the table every few months wont resolve.

    If this sounds like what you want to achieve let me know and I will be more than happy to provide better pointers.