Understanding CDN and QunarCache Architecture: Design, Cache Selection, and Operational Practices
This article explains the fundamentals of CDN, introduces QunarCache (CDN + Cache) architecture, compares cache solutions such as Squid, Varnish, ATS and Nginx, describes deployment patterns, operational monitoring, and future improvements for scalable, resilient content delivery.
CDN (Content Delivery Network) is a fast delivery system for images, text, music, movies, orders, and social media, aiming to reduce latency, improve user experience, and protect services from attacks and traffic spikes.
QunarCache extends CDN by adding a self‑built cache layer behind the CDN, ensuring source‑site safety and providing redundancy when a CDN fails, thereby handling sudden traffic surges.
The "CDN++" approach uses multiple CDN providers with intelligent DNS routing to achieve multi‑node, multi‑backup, and multi‑guarantee service, allowing comparison of quality, support, and price across providers.
Cache selection options evaluated include Squid, Varnish, Apache Traffic Server (ATS), and Nginx, each with distinct characteristics: Squid is mature but single‑process; Varnish offers high performance but limited cache size; ATS is feature‑rich but complex; Nginx is versatile but less mature for caching.
Deployment patterns explored are:
"Nginx + Squid Siblings" – horizontal memory scaling suitable for small clusters.
"Nginx UriHash + Squid" – offloads cache queries and enables capacity scaling as the cluster grows.
"Nginx UriHash + Squid Multi‑process" – adds multiple Squid processes to overcome Squid's single‑process performance limitation.
Operational practices include third‑party monitoring to assess user experience, real‑time health checks of QunarCache services, separating business clusters for independent management, and using SaltStack for automated service rollout and rollback.
Future improvement directions focus on data‑driven analysis of CDN logs for performance monitoring and alerting, and implementing self‑service failover by integrating QunarCache with QunarDNS for automatic fault switching.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
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.