codediodeio / geofirex

:globe_with_meridians: :round_pushpin: Geolocation Queries with Firestore & RxJS
https://geo-test-c92e4.firebaseapp.com/
477 stars 106 forks source link

Enhancement Request: optimization for firestore's cost? #5

Open henrylearn2rock opened 6 years ago

henrylearn2rock commented 6 years ago

As described at https://youtu.be/lO1S-FAcZU8?t=2m2s, there are inherited edge cases with geohash and they can be solved with doing more queries and filtering. However, since firestore's cost structure is based on number of reads, and more queries yield more latency, it would be great if geofirex can allow the user to pick whether they can live with certain edge cases to save the cost. What do you think?

codediodeio commented 6 years ago

Great idea. I was thinking about exposing additional methods that would be cost optimized.

nearby() Starts at the most precise geohash, then works up until X results are found. inGeohash() Searches only within specified hash, ignoring neighbors. This would make it easier to customize behavior.