Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cities drop down gets stuck #1

Open
THPubs opened this issue Apr 3, 2020 · 4 comments
Open

Cities drop down gets stuck #1

THPubs opened this issue Apr 3, 2020 · 4 comments

Comments

@THPubs
Copy link
Member

THPubs commented Apr 3, 2020

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.
@sacsand
Copy link

sacsand commented Apr 3, 2020

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.

@THPubs
Copy link
Member Author

THPubs commented Apr 4, 2020

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

@THPubs
Copy link
Member Author

THPubs commented Apr 4, 2020

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.

@sacsand
Copy link

sacsand commented Apr 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants