Geohash Vs Haversine Formula

المشرف العام

Administrator
طاقم الإدارة
I am storing latitude and longitudes of users in a table. Number of users will be really large. I want a way to find out near most users (latitudes, longitudes) for a given user (latitude, longitude). I am keen about accuracy and performance.

Form whatever I analyzed so far till now are two prominent methods being used to do this task these days

Use MySQL and Haversine Formula: (This presentation is quite popular)

Pros:

  1. Quite popular around last some years
  2. Great accuracy by a proven formula
Cons:

  1. Performance is major issue I saw being discussed
  2. Need to give distance then the query computes distances of all users withinthat area (If no user found in that distance application might got to retry with larger distance) Complex calculations involved each time.
Geohash system:

Pros:

  1. New approach invented for finding nearby coordinates quickly.
  2. Single column search for hashtags making in quick and simple no complex calculations involved. High performance.
Cons:

  1. There are some corner cases reported where it won't work
  2. Accuracy (? not sure on this)
Please can someone help me to chose between these two? What shall I consider for my application?



أكثر...
 
أعلى