survive-together-web icon indicating copy to clipboard operation
survive-together-web copied to clipboard

Cities drop down gets stuck

Open THPubs opened this issue 5 years ago • 4 comments

Currently the site loads all the cities in the database and tries to show them in the drop down which make things slow. We need to find a way to manage this without putting much strain on the server. Main concerns:

  • If we fetch data from the server as people type, it will put more strain on the server.
  • We need to keep the load to a minimum since this is a non profit project.

THPubs avatar Apr 03 '20 15:04 THPubs

How about using GunDB, browser-based peer to peer decentralized database Intro, GUN is a small, easy, and fast data sync and storage system that runs everywhere JavaScript does. The aim of GUN is to let you focus on the data that needs to be stored, loaded, and shared in your app without worrying about servers, network calls, databases, or tracking offline changes or concurrency conflicts. . more [here] how it works (https://gun.eco/docs/Introduction )

we can store frequently using data in the GunDB, Then so react app can directly fetch from a browser(gunDB) .this way we can keep the server load minimum.

Thanks.

sacsand avatar Apr 03 '20 18:04 sacsand

Can it deal with large amounts of data? We currently have 36,724 cities. We fetch all the data through Apollo.

THPubs avatar Apr 04 '20 12:04 THPubs

By the way, isn't it (GUN) too much for our situation? We don't need any security with the cities data. It's all public information.

THPubs avatar Apr 04 '20 12:04 THPubs

Data size will not be a problem if we use the gun correct way quoted from gun docs But how does it work?

There is no theoretical limit for the total size of a gun graph. The amount of data that a peer has locally available is limited by the memory constraints of the host environment, like operating system, browser, etc. The amount of data that can be persisted beyond the running process depends on the storage engine. In a web browser it will usually be 5MB of localStorage. A superpeer with Radix file storage can persist much bigger amounts of data.

Superpeers are dedicated gun peers running on NodeJS. They will receive all data that is broadcasted to the network and be able to serve it on request. Normal peers running in a web browser will not start downloading the whole database but only the parts they request. A well designed gun application will only download relevant data, instead of draining the users bandwidth and RAM. This and the general unreliability of browser peers make it essential to have one or more superpeers running 24/7 for the operation of most real world use cases.

yes agree on this particular use case, ' just to store country district list " Gun DB Is too much work.

sacsand avatar Apr 04 '20 18:04 sacsand