android, find the nearest location without going through all the locations
- by Marwan
I am building a taxi dispatching app
first: I need the passenger app to show the nearest taxis, now I know how to do that in code but in my way I have to go through all the taxis locations(in database on server) and calculate the distance from the passenger location and get the lowest ones - I don't want to do this because there will be a lot of taxis and going through all of them and making some math is kind of pain on the server- is there a way to get the nearest ones without going through all of them?
second: what the best database to use - first, should it be sql or non-sql - I need a very robust database, because there will be a lot of updates (I mean the passengers locations added then deleted when arriving to destination && the taxis location changes frequently)
finally: I will use RubyOnRails to do the server side and json as data transfer format, do you have a recommendation to me on something better?
Thanks