So your origin needs to be able to handle the tail and P2P can handle the popular stuff no? It isn't all or nothing. P2P could absolutely be used to peak shave. CDNs also have cold start issues with long tail.
Streaming video is not like static files from a torrent. The term "popular content" is a bit of a misnomer. Nominally with streaming a single uploaded video will be encoded into a number of different versions at different frame sizes and bitrates packaged into individual stream segments. So while a particular video URL might be popular, the actual video segments served to viewers will depend heavily on the configuration/environment of all the viewing devices.
So a FHD stream for a video could be super popular while a 480p version might not have any viewers. When some 480p viewers load the stream they don't get any benefit from the P2P/cache popularity of the FHD stream.
This is compounded by the fact that for video time to first byte doesn't matter very much. A decoder can't do anything with a single byte or even a partial stream segment. It's the time to locally buffer a decodable stream segment and a steady reception of segments as the play head reaches their time stamp.
If a segment gets held up (as happens with P2P) it can't be decoded so you either pause playback or drop frames (if you've got later segments available). You want the media segments to cover at minimum a single GOP (Group of Pictures) which is a relatively large I-frame and the following smaller P and B frames. If you were to tune the video segmentation such that each segment was some tiny time slice it would balloon the bitrate since you need way more I-frames. Super long GOPs don't help either because segment drops end up ruining playback until a new I-frame is received.
Streaming video is hard enough with a reliable CDN, adding P2P makes much harder and orders of magnitude less reliable.
So your origin needs to be able to handle the tail and P2P can handle the popular stuff no? It isn't all or nothing. P2P could absolutely be used to peak shave. CDNs also have cold start issues with long tail.
No, it'll be genuinely be worse, as you can't really have efficient P2P today.
Let's start with the points; I'm not talking about Europe or US today. P2P or CDN is a coin flip there, and I'll agree that P2P is as reliable as a CDN. I'll also agree that theoretically P2P and CDN will be a coin flip (performance-wise, I'm leaving monetary considerations in this discussion).
Those points break down quickly in Latin America, Asia and Africa. I'll talk about Asia as it is where I'm more familiar of, but the points apply also in Africa and Latin America. Outside of Jio and actual hosters/colos (meaning nearly all of residential and mobile connections), IPv6 in Asia is actually more unreliable than you think (it should not be, but that's peering fights for you) and IPv4 is CGNATTed heavily so P2P is no dice. Even if somehow there's a unique IPv4 for every device, internet connections there is very top-down, unlike with Europe's mesh-like connectivity.
How bad? It'll be better to route Telkom Indonesia's connections to America than to another hoster located in Indonesia or Singapore (nearest regional hub), unless you're Akamai which have agreed to buy colocation space inside Telin just to have good connectivity. And before you comment, OVH in Singapore has the precise issues we're discussing (https://lowendtalk.com/discussion/172659/ovh-routing-issues-...). Thus, it is miles better to use your time to build good CDNs with good connections (or spend money to Akamai) than bothering with the issues you'll face with P2P. Moreover, you can concentrate your money into buying a better data link (either by renting/IRU a dedicated wavelength or even fiber pairs) than relying on a best-effort service.
Funnily, even bittorent downloads in practice seems to be concentrated to a few seedboxens - even for purely legal downloads like GIMP.
Postscript: technically P2P and CDN would be the best for reliability, but you're spending the time to do it (instead dealing with a single thing) and deal with the possible fallout (like Windows Updates before Microsoft decided to limit P2P to local networks due to bandwidth and privacy concerns). Speaking of bandwidth concerns, I promised myself to limit monetary concerns just to point out that's it's not good in actual deployment, but I forgot data caps (not just a problem in Africa but in the US too)! It'll be a disaster when P2P is not voluntary because you just wasted their precious money!
Besides data caps on residential broadband, a non-trivial number of clients will be on mobile and have effectively zero ability to reseed content. To enable streaming from mobile devices requires a lot of server infrastructure to support hole poking and reflection.
Even with residential broadband without worries of data caps, there's still issues of firewalls and terrible upload speeds. Hole poking in residential firewalls like on mobile requires third party infrastructure. Most end users are not readily able to forward ports on their home routers. It's also not uncommon to see 10:1 downstream to upstream ratios. There's plenty of connections that couldn't manage to reliably upload a single FHD stream to a single client. It would take a hundred seeders with Comcastic upload speeds of 10Mbps to equal a single cheap VPS on a 1Gbps connection.
You can in Europe, but it is worth the dev time? It doesn't matter when monetary costs are second to principles, but it be wrong to think that most companies are spending their time fancying P2P.
Comments
So your origin needs to be able to handle the tail and P2P can handle the popular stuff no? It isn't all or nothing. P2P could absolutely be used to peak shave. CDNs also have cold start issues with long tail.
Time to first byte is pretty good, https://webtorrent.io/
To the OP, you should research some other options, are you sure that you are asking the right question?
Streaming video is not like static files from a torrent. The term "popular content" is a bit of a misnomer. Nominally with streaming a single uploaded video will be encoded into a number of different versions at different frame sizes and bitrates packaged into individual stream segments. So while a particular video URL might be popular, the actual video segments served to viewers will depend heavily on the configuration/environment of all the viewing devices.
So a FHD stream for a video could be super popular while a 480p version might not have any viewers. When some 480p viewers load the stream they don't get any benefit from the P2P/cache popularity of the FHD stream.
This is compounded by the fact that for video time to first byte doesn't matter very much. A decoder can't do anything with a single byte or even a partial stream segment. It's the time to locally buffer a decodable stream segment and a steady reception of segments as the play head reaches their time stamp.
If a segment gets held up (as happens with P2P) it can't be decoded so you either pause playback or drop frames (if you've got later segments available). You want the media segments to cover at minimum a single GOP (Group of Pictures) which is a relatively large I-frame and the following smaller P and B frames. If you were to tune the video segmentation such that each segment was some tiny time slice it would balloon the bitrate since you need way more I-frames. Super long GOPs don't help either because segment drops end up ruining playback until a new I-frame is received.
Streaming video is hard enough with a reliable CDN, adding P2P makes much harder and orders of magnitude less reliable.
No, it'll be genuinely be worse, as you can't really have efficient P2P today.
Let's start with the points; I'm not talking about Europe or US today. P2P or CDN is a coin flip there, and I'll agree that P2P is as reliable as a CDN. I'll also agree that theoretically P2P and CDN will be a coin flip (performance-wise, I'm leaving monetary considerations in this discussion).
Those points break down quickly in Latin America, Asia and Africa. I'll talk about Asia as it is where I'm more familiar of, but the points apply also in Africa and Latin America. Outside of Jio and actual hosters/colos (meaning nearly all of residential and mobile connections), IPv6 in Asia is actually more unreliable than you think (it should not be, but that's peering fights for you) and IPv4 is CGNATTed heavily so P2P is no dice. Even if somehow there's a unique IPv4 for every device, internet connections there is very top-down, unlike with Europe's mesh-like connectivity.
How bad? It'll be better to route Telkom Indonesia's connections to America than to another hoster located in Indonesia or Singapore (nearest regional hub), unless you're Akamai which have agreed to buy colocation space inside Telin just to have good connectivity. And before you comment, OVH in Singapore has the precise issues we're discussing (https://lowendtalk.com/discussion/172659/ovh-routing-issues-...). Thus, it is miles better to use your time to build good CDNs with good connections (or spend money to Akamai) than bothering with the issues you'll face with P2P. Moreover, you can concentrate your money into buying a better data link (either by renting/IRU a dedicated wavelength or even fiber pairs) than relying on a best-effort service.
Funnily, even bittorent downloads in practice seems to be concentrated to a few seedboxens - even for purely legal downloads like GIMP.
Postscript: technically P2P and CDN would be the best for reliability, but you're spending the time to do it (instead dealing with a single thing) and deal with the possible fallout (like Windows Updates before Microsoft decided to limit P2P to local networks due to bandwidth and privacy concerns). Speaking of bandwidth concerns, I promised myself to limit monetary concerns just to point out that's it's not good in actual deployment, but I forgot data caps (not just a problem in Africa but in the US too)! It'll be a disaster when P2P is not voluntary because you just wasted their precious money!
So, your origin needs to handle the parts of the world with bad internet infrastructure, but can use P2P in Europe and the US, then?
Besides data caps on residential broadband, a non-trivial number of clients will be on mobile and have effectively zero ability to reseed content. To enable streaming from mobile devices requires a lot of server infrastructure to support hole poking and reflection.
Even with residential broadband without worries of data caps, there's still issues of firewalls and terrible upload speeds. Hole poking in residential firewalls like on mobile requires third party infrastructure. Most end users are not readily able to forward ports on their home routers. It's also not uncommon to see 10:1 downstream to upstream ratios. There's plenty of connections that couldn't manage to reliably upload a single FHD stream to a single client. It would take a hundred seeders with Comcastic upload speeds of 10Mbps to equal a single cheap VPS on a 1Gbps connection.
US is out because data caps.
You can in Europe, but it is worth the dev time? It doesn't matter when monetary costs are second to principles, but it be wrong to think that most companies are spending their time fancying P2P.