OpenHospitalityNetwork / ohn-solid

[deprecated, see https://github.com/solidcouch/ instead] A hospitality exchange platform for bicycle touring community where members own their data and which can be connected with other similar communities in the decentralized hospex network.
https://solid.openhospitality.network/
MIT License
7 stars 2 forks source link

Displaying a map makes read requests to Pods of all members of the community #13

Open mariha opened 2 years ago

mariha commented 2 years ago

This is not scalable at all.

Potential solution: On a server side, have a list of geolocation points and member ids. That list (probably a db with an R-tree or any other geospatial index) could be queried for users in a range to display. It should be updated every time a member changes location of their offer. Based on member id details of the offer could be read from the pod when needed only.

Note on keeping the list/index up-to-date: Inrupt libraries for Solid have a feature to subscribe for notifications on data updates, but it’s available for Enterprise servers only. We’d have to make updates whenever a user updates theirs offer location from our frontend code and be aware that it may get stale if a user changed it directly in the pod (what should probably be discouraged and should not happen often anyways).