I plan to store and update user locations (lat, lon, userid) via websocket on a nodejs server. my goal is to broadcast the user locations to every user, as fast as possible. (like the mytaxi position of each taxi in the app)
my concerns / problems
questions:
my way
i would go for two arrays (arr1 sorted by lat, arr2 sorted by lon) -> search via divide and conquer -> check on similar ids -> output
is there a better way to do this?
thanks in advance
alex
you can use Redis's pub/sub channels, create a channel for each bounding box and subscribe users to the relevant channels according to their location report, then push messages to entire channels.
this strategy may be naive for big data..