YouIn order to calculate a meaningful distance, we must treat geographic coordinates not as approximate Cartesian coordinates but rather as true spherical coordinates. We must measure the distances between points as true paths over a sphere.
So we should use geographic types instead of geometric, that are planar and don't take into account earth's curvature (inaccurate distances), so for your task is better PostgreSQL/PostGIS geography type and functions