Hacker News new | ask | show | jobs
by agentultra 2336 days ago
I wonder how much more efficient this would be if the content was distributed on a p2p network?

I would love to get into distributed web tech. I'm not sure how much of a market there is for it though.

The benefit of being able to have these scuttlebutt networks of low-power, efficient devices is a lower-overall carbon footprint for the common case of serving low-fidelity content like web pages and small applications. As well as the network and content being resilient to local changes in climate events (flash floods, fires, etc). And possibly bringing access to more areas where network connectivity is slow, expensive and unreliable.

2 comments

> I wonder how much more efficient this would be if the content was distributed on a p2p network?

This is pure speculation on my part, but probably much less efficient. In order to make the p2p network reliable, you'd need many more copies floating around. I also suspect that "finding" your data is more energy intense compared to basic DNS lookups.

It's possible to use erasure coding to avoid needing that many more copies. With 75% erasure blocks you can lose any 75% of the nodes hosting the data without compromising availability, and that only requires the equivalent of four copies. Moreover, distributing that number of copies has negligible overhead when data is requested much more often than it's modified, as is normally the case.

It's also possible to cache lookups in the same way as DNS by having larger nodes cache the lookup data and having smaller nodes query them, so that the most common queries are satisfied using a single request to a lookup cache.

Meanwhile the advantage of a P2P network is that most of the nodes are client devices which would have been powered on regardless, instead of needing additional devices dedicated only to hosting data.

> powered on regardless

Bad assumption: Most people use laptops, which aren't "powered on regardless", or mobile devices, where the power consumption of being active on a P2P network will kill the battery.

The people using laptops wouldn't leave them on longer than they would be otherwise, you'd just get the data from the one that happens to be on at the time, so they'd be "powered on regardless" for the same period of time they would be otherwise.

Moreover, the average mobile device spends something like eight hours a day (while the owner is asleep) connected to the charger where battery life is irrelevant. So give the network two modes, one where the device participates fully in the network and is a preferred source for data and one where it only registers what it has with another node and is then a provider of last resort for data not otherwise available elsewhere, and operate in one mode or the other depending on whether the device is running on battery.

Notice also that the amortized number of hits over the whole network is one per object per device, i.e. the average number of times a node has to upload each thing it downloads is only once. That doesn't take an insurmountable amount of battery even if you couldn't shift most of the load to the devices that are plugged in.

Does it need to be always on though? Scuttlebutt-like gossip networks and caches might be more what I was thinking about. In the ideal case you find the content local to you in one request, cache it, and the solar-powered server is none the wiser.

The network might be slower overall but we're talking about optimizing for lower power consumption so I feel like that would be a lesser priority.

Now I'm starting to wonder if there is a away to simulate the power draw of such a network.

There was a project I stumbled upon over a year ago that implemented a P2P Web, but I can't seem to dig it up now. There was a client that mediated the connection between your machine and the network, and you'd just browse the web normally by pointing your browser at localhost:someport. It was kind of neat, since everyone who visited a resource could act as the server for somebody else, but it looked to me like it was pretty much only used by Chinese dissidents. Good for them, I say, but not so useful for someone casually looking for a better version of the existing Web. I think until technologies like this are better than the Web for ordinary use, not just hiding from authorities for whatever reason, they'll only find use in those areas.

Of course, there's always IPFS, but that project comes with its own issues (e.g. modifying content).

Were you thinking of i2p? I believe it's a similar project that I've always intended to look into, but never actually have.
Check out Beaker Browser!
That looks neat. I'll put it on my list of things to play with eventually.
Zeronet?
Indeed, it was Zeronet. Thank you for reminding me!