We are trying to build live stream application which should be able to handle thousands of simultaneous live streams and thousands of viewers per each live stream. We going to use Google Cloud Platform for that. The app will work on mobile platforms (iOS and Android) so we planning to use GoCoder with RTMP as an input format and HLS as output format for playback. Single bitrate stream will be transcoded to lower bitrates on WSE, so we will have multi bitrate output HLS. Also live streams should be saved for further VOD playback using HLS.
As i understand there is no ready solution for autoscaling and load balancing of origin servers as the number of live streams grows, also since we use HLS, the most straightforward solution for distribution will be CDN, based on this i can think of 2 possible solutions for the moment:
Build cluster of HTTP origin servers using GCP load balancer and use some HTTP proxy CDN like CloudFront. But in that scenario i’m not sure how to implement stream stickiness, to make load balancer be able to redirect CDN requests for HLS files to proper origin server. Is there any API or modules that could help to implement such stickiness?
Another approach is similar to the first one, we also will need to build cluster of HTTP origin servers using GCP load balancer, but instead of HTTP proxy CDN, write a module or implement custom stream target that will upload produced HLS files to Google Storage and play stream directly from the storage using Google CDN. Is there any ways to upload produced HLS to Google Storage?
What other approaches can be used to build something like that? Thanks!