Dweb: Building a Resilient Web with WebTorrent
hacks.mozilla.org
hacks.mozilla.org
Basically it is a family of error correcting code which splits the data in N+M distinct pieces, and allow you to reconstruct the data once you have any distinct N of these pieces. This allow you to seed any one of these small pieces yet allow the reconstruction of the whole data provided there are enough other people seeding other pieces (Typically number of "seeds" will increase between x100 and x1000 (Note that it obviously don't increase the outgoing bandwidth of your network, but it makes it a lot easier to conserve and distribute rare files). Which also means any of these pieces can help getting the first packets needed to begin streaming which reduces latency. The negative aspects, are : - bigger "torrent" files (because you need to store the hashes of more pieces). - Some time you'll download an extra piece. - More compute power needed on the clients to decode the stream. - More complexity in the code.
Why is it not implemented ? Mainly because it is not a standard yet. There is quite a lot of freedom in the ways to implement it, and it will probably fracture the pools with plenty of non compatible protocols. And if you have a new version of the protocol to improve some things you need the seeds to re-encode the data to be protocol compatible.
That is also probably a subject which is encumbered by software patents.
Economically targeting the fat tail of rare torrents is probably not worth it.
It's fun algebra you should check if you don't know it already :)
Plus the recombination computation can get expensive over lots of data.
While this might reduce latency, it sounds like in practice it'd multiple the redundancy of the system and make it even less cost effective?
If I have a stupid simple scheme where I split a file into 100 pieces and replicate each piece 3 times, I have a 100C1 * p^3 chance of irrecoverability where p is the independent probability of pieces dropping out.
I guess I just want to know, given arbitrary p, what the probability of the file being gone is.
So as long as your nodes uptime is greater than 33% + eps, the file is not gone. The eps is quite small because of the law of great number.
For example if your node uptime is 50%, the pieces will be in average available on 300 * 50% = 150 +- C*uptimevariance /sqrt(N) nodes which is greater than 100 with probability ~ 1, so the file will be recoverable almost surely.
This should also be in the spirit of Tim Berners-Lee.
This is built with WebRTC - so it uses the browser's native peer-to-peer API. But these other protocols also have WebRTC libraries, so it kind of all washes out. I only know dat really well, so I'm not an expert on all of this yet - but I'd say that the choice of protocol is less important than the maturity of the software.
For me, I was drawn to dat because of its incredible wealth of libraries (and the sweet Beaker Browser) - but if you're just serving video over WebRTC, you'd need to jump in and see how each library works for your specific project. In my mind, these are all really great projects.
Or just start using IPv6 already.
If you want to seed a file for long term you can use the webtorrent-cli or webtorrent app as well.