4 ms·
Hi I hope its okay to ask you here. I am looking at supabase because someone recommended to me that it uses postgres. My current backend uses postgres and pos
by swman 5y ago
Hi I hope its okay to ask you here.
I am looking at supabase because someone recommended to me that it uses postgres.
My current backend uses postgres and postgis and I was looking for real time geospatial service. I'm wondering does supabase make it easy for me to do real time geospatial querying, something like open a listener for radius(10km) around the user and have it continually update the results around me? I see that you have postgis extension available, so can I do that thing I mentioned?
I'm using firebase currently, with geofire, for the real time aspect of my app. It have limitations like can't do ordering or additional filtering because of the geofire approach.
Please let me know, and good luck with Supabase !
- kiwicopple 5y agoYour use-case is a bit novel, so it might be worth asking in our forum to make sure I haven't misunderstood your requirements: https://github.com/supabase/supabase/discussions https://github.com/supabase/supabase/discussions I think we have all the pieces in place for you to use: - a Postgres database with PostGIS - a Realtime listener for listening to database changes I don't know if you need realtime though if you are constantly sending the user's location to the database. It might look something like this: - Turn on PostGIS - Create a Postgres function which takes in the user's location and calculates radius results. eg: get_objects(lat text, lng text, radius smallint) - Call this function from the client every XX seconds using the client[0] `supabase.rpc('get_objects', { lat, lng, 10 }) Hope that gives you a few ideas! [0] RPC: https://supabase.io/docs/reference/javascript/rpc https://supabase.io/docs/reference/javascript/rpc
- swman 5y agoThanks! That's awesome. I made a lot of progress yesterday with supabase, setting up some tables and auth :D I really like it, and I'm going to keep maintaining a secondary project with it just to keep up with all the good work. Seriously, all the best!