Currently, I'm working on a project like Uber. It means there are two apps: one for driver and one for customer.
The issue is: the driver need to update their location per 2 seconds. And the customer pull all the nearest drivers per 2 seconds for realtime. It cause bad performance in database query. I use cube & earthdistance extension of PostgreSQL for caculating the nearest.
Could anyone show me what's the best way to solve this issue? Thanks a lot!
You could use deepstream.io for realtime data submission, e.g. from Android
to JavaScript
Combined with e.g. RethinkDBs geospacial queries which deepstream integrates with this might be a scalable solution.
Here's an example repo demonstrating this