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!