i'm building "generic tinder" mobile app must find people close me (like 100m, 1km, etc)
guys tell me if im going in right direction?
i'm using elastic search check distance, it's cool, 800 users , can calculate under 100m radius in 3ms.
the problem is : synchronize position of users meteor server , server elasticsearch server.
on each client, watch mobile's gps position , whenever changes , call server method updates mongo database , sends update request elasticsearch server update position there (im using geohash 3m precision)
i'm concerned scalability issues.
1. should clients send position directly elasticsearch server?
if so, how can authenticate them?
2. on mobile client app, should watch every single change on position or code timing algorithm?
2. have other approaches on how build kind of relation client-server?
thanks! need help, guys!
my opinion:
- no, sending position mongodb via meteor method first best
- definitely don't watch every single change. recommend timing algorithm checks every 5 minutes (how far can travel in 5 min unless you're on airplane?).
- professional developers use called exponential backoff. can fancy , like: a) wait 1 min , check location change, b) if no change, wait 2 mins , check, c) if no change, wait 4 mins , check, d) if no change, wait 8 mins , check, e) well, idea. can set max of 16 mins if want. note google uses handle errors.
Comments
Post a Comment