Beyond Broadcasting: Apache APISIX's Cutting-Edge Tactics for Immersive World Cup Live Streaming

January 8, 2024

Case Study

Preview

About Migu Video

Migu Culture and Technology Group Co. (Migu), a subsidiary of China Mobile, functions as an integrated professional entity responsible for providing, operating, and servicing digital content products. It encompasses five sub-companies: Migu Music, Migu Video, Migu Digital Media, Migu Fun, and Migu Animation. Migu has emerged as a leading comprehensive platform in China that boasts an extensive collection, including over 35 million songs, 4.6 million videos, 600,000 publications, 1,100 games, and 750,000 episodes of new digital content.

Being committed to innovating in "Internet + Digital Content" operations, Migu aims to integrate various content with multiple channels and bring about a transformation in users' entertainment lifestyles.

Challenges

  • Video services cope with a substantial volume of user requests, necessitating robust handling of high-concurrency situations.
  • Ensuring real-time data transmission and display is critical for live streaming scenarios, demanding seamless and instant user experiences.
  • Supporting diverse video formats and transmission protocols while leveraging CDN acceleration is crucial for efficient content delivery and enhanced user experiences.

Results

  • Apache APISIX supports Migu Video successfully in high-concurrency live streaming during the 2023 FIFA Women's World Cup, the 2023 FIBA Basketball World Cup, the Hangzhou 2022 Asian Games, and the Chengdu 2021 Summer World University Games.
  • Apache APISIX's routing capabilities enabled Migu Video to improve the user experience, enhancing content delivery for swift user access, fostering seamless streaming, and elevating users' satisfaction.
  • By leveraging Apache APISIX, Migu Video has witnessed a significant boost in request processing speed, and a more streamlined backend architecture while reducing operational complexity.

Background

Migu Video faced several challenges in its business scenarios, including high concurrent access, high-security requirements, and fault recovery. The live streaming scenarios are demanding in transmission requirements and require support for multiple formats and protocols, and content delivery acceleration through Content Delivery Network (CDN). The characteristics of Migu Video's business can be concluded as:

  • High Traffic and High Concurrency: Video services typically face a large number of user requests and require handling high concurrency situations.
  • High Real-time Requirement: Ensuring real-time data transmission and display in live streaming and similar scenarios is crucial.
  • Support for Multiple Formats and Protocols: Video services may involve various video formats and transmission protocols.
  • CDN Acceleration: To provide a better user experience, video services often use CDN for accelerated content delivery.

Migu Video Uses APISIX

Why Migu Video Opted for Apache APISIX?

Migu Video, during its technology selection process, carefully considered several factors that led to its decision to opt for Apache APISIX as its API gateway solution. Apache APISIX stood out as an open-source API gateway offering a range of essential features, such as high performance, high availability, and scalability. These qualities were instrumental in meeting Migu Video's requirements for a robust and efficient API gateway. Besides, the technical team of Migu Video particularly values Apache APISIX for its high performance, dynamic routing capabilities, security protection, and the flexibility of its plugin system.

1. High Performance and Dynamic Routing

Migu Video has the urge to handle a large volume of API traffic while maintaining an excellent user experience. Apache APISIX, equipped with exceptional performance and dynamic routing capabilities, can be an effective and precise solution for Migu Video, ensuring that requests are distributed optimally and processed with minimal latency.

2. Resilient Security Framework

Security protection is paramount for Migu Video, and Apache APISIX offers robust security features that align with Migu Video's requirements. With features such as request/response transformation, access control, and SSL/TLS encryption, Apache APISIX safeguards Migu Video's API infrastructure from potential threats and ensures the integrity of data transmission.

3. Over 100 Open-Source Plugins

Migu Video values the flexibility of Apache APISIX's plugin system with 100+ open-source plugins, covering traffic management, observability, security, request/response transformation, serverless computing, and more. Apache APISIX's scalability allows Migu Video to integrate custom functionalities seamlessly and adapt the API gateway to future needs.

4. Supporting Multiple Protocols

One significant advantage of Apache APISIX is its support for multiple protocols, including HTTP, WebSocket, and gRPC. The versatility of protocols supported by Apache APISIX provides essential functionalities like rate limiting, authentication, authorization, and logging and enables Migu Video to handle various types of API traffic, accommodating the diverse needs of its platform.

5. Cloud-Native and Microservices-Oriented

Apache APISIX's strength in microservices frameworks and cloud-native environments is another valuable aspect that appealed to Migu Video. As organizations increasingly adopt microservices architecture and leverage cloud-native technologies, Apache APISIX's compatibility and seamless integration with these environments provide a solid foundation for Migu Video's future growth and scalability.

Apache APISIX's Implementation in Large-Scale Video Services

Migu Video's implementation of Apache APISIX can be divided into several parts: leveraging Apache APISIX to explore its management capability, making customization based on Apache APISIX, using monitoring and alerting plugins, and adapting Apache APISIX for other operating systems, etc.

Leveraging Apache APISIX to Explore Management Capability

Considering the specific use cases of Apache APISIX in Migu Video's business scenarios, it focuses on traffic scheduling and management, dynamic routing, and security protection.

  • Traffic Scheduling and Management: Migu Video has been exploring traffic scheduling and management, aiming to better manage the traffic scheduling and rate limiting, thus avoiding or intercepting certain requests by leveraging Apache APISIX plugins.

  • Dynamic Routing: Dynamic routing was one of the key features that initially attracted Migu Video to Apache APISIX. Migu Video's previous centralized gateway mainly relied on a version of OpenResty, which posed risks in modifying routing configurations as business needs frequently changed. Apache APISIX's dynamic routing and hot configuration through Dashboard allows Migu Video to publish changes without reloading the services.

  • Security Protection: Migu Video aims to utilize Apache APISIX's security protection features to safeguard its video services from various network attacks effectively. For instance, by configuring Apache APISIX's firewall rules, Migu Video can filter out malicious requests and ensure the stable operation of its business.

APISIX Handles Concurrency Scenarios for Migu Video

Gateway Customization Based on Apache APISIX

While Apache APISIX has successfully fulfilled all of Migu's fundamental requirements, the distinctive nature of Migu Video's business necessitates some tailored development to further align with their specific needs. Consequently, Migu Video has completed their customization of 11 sets of gateways, as well as 4 sets of environments waiting for release to the production environments.

These 11 sets of gateways cover the main gateways of Migu Video's centralized business. For example, there is a public gateway for user login, a user management center gateway responsible for user authentication capabilities, a sales gateway for user product purchases, and the Professional User Generated Content (PUGC) gateway required for the newly added live streaming business in 2023. Additionally, the gateway for cinema ticketing has also been transformed.

The current Apache APISIX gateway environment at Migu Video generally follows a dual-data center architecture. Each data center has multiple Apache APISIX services, a set of etcd clusters with 3 nodes typically, and a dashboard service for frontend route configuration. Furthermore, the self-developed signature verification and token verification plugins are used mainly for gateway signature and token validation.

Monitoring and Alerting Enhancements

Apart from the self-developed plugins and some aided monitoring solutions, Migu Video also utilizes the built-in Prometheus and Grafana plugins, enabling efficient data collection, storage, analysis, alerting, and visualization.

Prometheus and Grafana are official plugins provided by Apache APISIX, which are used by Migu to monitor metrics such as error rates, latency, TPS, the health of the etcd clusters, shared memory status, and message-sending rate within the Apache APISIX gateway. What's more, these metrics are typically displayed in visual charts, providing a more intuitive and clear view of the system's performance.

APISIX's Built-in Plugins: Prometheus and Grafana

Adapting Apache APISIX for Other Operating Systems

To enhance the competitiveness of Migu, many other operating systems coexist within Migu Video, during which they encountered some challenges.

  • Environment Differences: Due to certain differences among Windows, Unix, Linux, and other operating systems, we had to make adjustments for compatibility with different dependency libraries.

  • Package Management: Owing to the customized dependency packages of various operating systems, we needed to reconfigure some foundational software packages to ensure compatibility.

  • Performance: Initially, we were unsure about the performance of Apache APISIX on a new operating system. Therefore, we conducted several testing phases.

After addressing the dependency package-related issues in a test environment, Migu Video conducted stress testing on a set of PUGC gateways. The robustness of Apache APISIX has been proved by the Four International Competitions in 2023, including the Hangzhou 2022 Asian Games, the Chengdu 2021 FISU World University Games, the 2023 FIFA Women's World Cup, and the 2023 FIBA Basketball World Cup.

The practical testing of Apache APISIX on the new operating system has proved that Apache APISIX can perfectly meet Migu Video's business requirements by handling many concurrent live-streaming sessions on the new operating system.

Smooth Sailing with API7.ai's Technical Support

During the initial deployment of Apache APISIX, Migu Video received exceptional technical support from API7.ai, the creator of Apache APISIX.

API7.ai provided invaluable assistance by conducting inspections in the production environment and meticulously scrutinizing every aspect of the deployment. API7.ai also worked closely with Migu Video to address various issues promptly. This included adjustments to plugins and resource allocation, resolving potential issues that may have been encountered in the live environment.

Benefits after Adopting Apache APISIX

After using Apache APISIX, Migu Video has experienced a multitude of remarkable enhancements across its business operations.

  • Enhanced Request Processing Efficiency: Apache APISIX utilizes a high-performance asynchronous non-blocking design, enabling it to handle a large number of concurrent requests. By leveraging Apache APISIX, Migu Video has witnessed a significant boost in request processing speed, enabling swift and efficient delivery of video content to its users.

  • Improved Performance and Reduced Latency: Apache APISIX's intelligent routing and proximity-based node distribution strategies have played a pivotal role in reducing network latency for video-related businesses while maintaining high performance in high-concurrency situations. Migu Video has witnessed firsthand how Apache APISIX's routing capabilities have contributed to faster content delivery, enabling users to access video content promptly and enjoy a seamless streaming experience.

  • Increased Scalability and Stability: Apache APISIX itself has strong scalability, high availability, and fault-tolerance mechanisms, scaling horizontally, reducing the impact of backend service failures, and improving the overall stability of Migu Video's business. The enhanced scalability and stability provided by Apache APISIX have solidified Migu Video's operations, allowing it to deliver a reliable and consistent video streaming experience to its customers.

  • Simplified Architecture and Operations: Apache APISIX provides rich functionalities and plugins, resulting in a more streamlined backend architecture while reducing operational complexity. This, in turn, improves development and operational efficiency.

The implementation of Apache APISIX has brought numerous tangible benefits for Migu Video. The impact and lessons learned from this implementation extend beyond Migu Video, offering valuable insights and guidance to other players in the industry.

Looking to the Future

Migu Video takes containerization as a long-term strategy, which is gradually migrating from VM to Kubernetes. After considering the business characteristics and the current API gateway usage, Migu Video regards the APISIX Ingress Controller as the best choice.

In summary, APISIX plays a crucial role in Migu's large-scale video-related businesses. Its practical implementation not only enhances business performance and simplifies backend architecture but also provides strong support for the rapid development of the business. In the future, Migu will look forward to the continuous evolution of Apache APISIX, bringing more value and innovation to large-scale video-related businesses and other domains.

Tags:
Streaming Media