Read data from Database, show results within Radius?

Hi,
I need to make an app where users are able to create profiles and mark their geo locations in a map.
Then, another app will need to display those users within a given radius from the search location. Kind of like uber. But there are others criteria than just the location.

anyway, can somebody guide me how to retrieve data within a given radius?
what should be the best database to use? Would firebase and firestore be good for commercial use?

thanks alot

Hi @KAD9_911 you just need to store the lat and long of does users in the database and then do a query that retrieves the users within a range of lat long that you set. There are lots of videos and examples online.

In terms of the database, I would say Firebase is perfect for this. You have real-time updates of the user location at a very low price and it is optimize for apps like this.

You can use any of the databases, but I would recommend Firestore. I’ve worked with the real-time database since the begining and now I’m changing to Firestore, the collection/doc system is much more practical and easy to maintain, and in my opinion at one point the will pivot everything to Firestore. They are giving much more attention and functionality.

But you said there are other criterias for the query’s, and Firebase has its limitations over other db like graphQl. So open a test project and test some query’s with the params you need and see if you can make it work. :wink:

1 Like