Rorical / pointers

decentralized kv store based on pubsub in libp2p
7 stars 2 forks source link

how to pub one host, and fetch it on the other host? #1

Open gosgos11 opened 2 years ago

gosgos11 commented 2 years ago

If there are many nodes on different machine, one node pub data, how to fetch data from other nodes? If pub node goes offline, other nodes can fetch the data?

Rorical commented 2 years ago

First, this repo is not finished so the program can't be used, you can only copy some code to use elsewhere.

Similarly, in a decentralized system, if the data is required to be retrievable, then at least some nodes must hold that data. Also, there must be some way for nodes to find which node has the target data. This is always done by using DHT. So the nodes that hold data must be online.

For the PubSub network, every node is sending messages that notify each other. Therefore, ONLY online nodes can receive the information published by other nodes. They can not fetch PubSub data.

But for networks such as IPFS, the data can be stored in other nodes to ensure its availability.