How Huya Strengthened Live Streaming with Nacos: DNS-F, Service Registry & Config
This article explains how Huya leveraged Nacos for DNS-F, unified service registration, CMDB integration, and dynamic configuration to improve live‑streaming stability, reduce latency, and enable flexible traffic steering across multiple data centers.
Why Choose Nacos
Huya started using Nacos from version 0.2 (latest Pre‑GA v0.8) and became an early enterprise user, contributing to the community.
Nacos is a cloud‑native dynamic service discovery, configuration, and management platform offering registration, configuration, and DNS‑F capabilities.
DNS‑F Technical Value
Nacos DNS‑F fills the gap of global dynamic scheduling for Huya’s multiple microservice systems, allowing the fusion of four registration centers into a single unified registry.
It solves high latency, inaccurate resolution, and slow fault tracing caused by fragmented service discovery.
By intercepting OS‑level DNS requests, internal services are resolved via Nacos while external domains are forwarded to the local DNS.
DNS‑F Application Scenarios
In database high‑availability scenarios, DNS‑F enables rapid IP switching when a primary node fails, eliminating manual coordination and reducing failover time from minutes to seconds.
Optimizations to LocalDNS reduced average resolution time from >200 ms to <2 ms, increased cache hit rate from 92 % to >99 %, and eliminated the 1‰ failure rate.
Service Registration Practice
Huya’s core services run on the Tars microservice framework, which primarily supports C++. By using Nacos’s DNS protocol, service discovery became language‑agnostic.
Nacos also synchronizes multiple data sources (Taf, its own store, ZooKeeper, K8s) and provides bidirectional sync (Nacos‑Sync) across domestic and overseas availability zones, achieving a single registration with multi‑region read capability.
CMDB Integration for Proximity Access
Nacos defines an SPI interface for third‑party CMDBs; implementing this interface and placing the JAR in Nacos enables seamless data exchange.
In practice, DNS‑F is integrated with Taf’s central control interface, providing cached load balancing and instance information while Nacos supplies query interfaces.
Service Configuration Practice
Huya’s domain (www.huya.com) spans multiple IDC data centers with Nginx load balancers. Traditional configuration propagation was slow and error‑prone.
After adopting Nacos as a configuration center, clients listen for updates, achieving near‑instant configuration rollout and reducing service expansion time by several minutes.
Overall, Nacos‑driven DNS‑F, service registration, CMDB linkage, and configuration management have markedly improved latency, reliability, and operational efficiency for Huya’s live‑streaming platform.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
