The Global Forecast predicts that the global video streaming software market is expected to grow by 19.7% annually (Compound Annual Growth Rate) during the forecast period until 2025.
The main factors driving the growth of the video platforms include increasing penetration of mobile devices and internet users, growing demand for VoD streaming and impact of COVID-19 pandemic. Many companies from different industries immediately react to this market demand and look for custom video streaming solutions.
The client is one of the biggest players in online ticket selling operations in Central Europe and wanted to fulfill its customers demand for online content. They requested a video platform that would be able to communicate with its online ticket selling website and capable of handling up to 40K parallel users. The main idea was simple: right after the customer purchases a ticket for an online content he can watch the purchased video stream on his TV, smartphone or computer. In other words the client wanted to implement and integrate pay-per-view service at a large scale.
The challenge was to develop a video platform that would meet following requirements:
Our team of developers and devops engineers are well oriented in cloud design patterns and end-to-end (Day 0/Day 1/Day 2) cloud based solutions. Based on our experiences we designed a platform according to defined requirements, focused on the high load expectations.
The video platform backend was written in Lua, blazingly fast and lightweight scripting language which can be embedded directly inside Nginx web server. We decided to choose OpenResty project as a backend platform that integrates Nginx core, enhanced version of LuaJIT and many useful Lua libraries. The client requirements for different levels of security were covered. Each sold ticket cointans unique token which is propagated from client’s website to our video platform via API. Token is used for client authentication and to keep an eye on any parallel connections. Incoming traffic can be filtered by IP address geolocation. Geo IP address database is updated on a regular basis. Designed API is used for user’s token registration and also as an admin console where the video content management system is provided.
Proposed video platform backend keeps its data (user’s tokens, video URLs) in the Redis in-memory data storage. Redis is another extremely fast piece of our video platform puzzle. The data persistence is ensured by Redis point-in-time snapshots at specified intervals. The backups of provided snapshots are stored in our backup server located in different DC.
Each registered video content is delivered to multiple CDNs from different providers to ensure redundancy. In case of failure, the affected CDN provider can be removed from the list of providers (via API) which guarantee a smooth run.
Proposed video software and related components are packed in containers, tested by our GitLab CI pipelines and finally (to achieve high availability and scalability) shipped into the Kubernetes cluster. Application observability is ensured by complex dNation Kubernetes Monitoring solution. It provides a clear overview of relevant application metrics side-by-side with logs, which rapidly reduces incident resolution time.