The ongoing COVID-19 pandemic has repeatedly disrupted daily life and work. Over the past half year, I’ve experienced a lot—family members fell seriously ill, my grandmother passed away, and there were numerous personal matters to handle, which led me to pause blogging for six months.

Amid economic downturns, many industries have begun layoffs and business scaling back. Taking advantage of recent free time, I’m summarizing my past experience with CDN services.


I. Architectural Analysis of Large-Scale Websites

In the mobile internet era, designing architectures for high-concurrency large-scale websites is far from simple. Here’s a concise overview across several key aspects:

1. Client Side:

Devices include desktop PCs, mobile phones, smart devices, etc.

Browser layers mainly consist of Chrome, Microsoft IE/Edge, Safari, Firefox, Opera, etc.—classification is primarily based on browser engines.

Protocol layer:

  • (1) Standard web pages: HTTP/1.1, HTTP/2, QUIC
  • (2) Streaming media: RTMP, HTTP-FLV, HLS (m3u8)

2. CDN Layer:

For small to medium-sized websites, commercial CDN services are usually sufficient.

For large or ultra-large websites, a hybrid approach—combining self-built and commercial CDN—is recommended. This will be discussed in detail later.

In the CDN domain, two core components dominate: caching layer and routing layer.

Depending on business scenarios, typical use cases include:

  • Static content acceleration
  • Dynamic content acceleration
  • Download acceleration
  • Audio acceleration
  • Video acceleration
  • Live streaming acceleration
  • P2P acceleration
  • Security acceleration

3. Static Services:

Frontend delivery models typically involve H5, mini-programs, Android, iOS. Core assets include HTML/CSS/JS.

Popular frontend frameworks: Vue, React, Angular.

Typically served via Nginx or OpenResty on the backend, with SSL certificates, expiration policies, CORS configurations, etc., properly set up.

4. Dynamic Services:

Based on the company’s primary programming language—commonly PHP, Java, Go, Python, etc.

Most companies now run dynamic services within Docker or Kubernetes clusters.

If true static/dynamic separation isn’t feasible and traffic must go through CDN, it’s advisable to configure origin-pull strategies to minimize routing overhead.

5. Data Caching Layer:

Common solutions: Redis, Memcached.

In cloud-native ecosystems, etcd and TiKV are also used for caching purposes.

6. Database Servers:

Traditional relational databases: MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, DB2.

NoSQL alternatives: MongoDB, HBase, Cassandra (Facebook), etc.

With increasing demands for performance and massive data handling, modern distributed databases are gaining traction:

  • TiDB (open-source by PingCAP)
  • Greenplum
  • DorisDB (open-source by Baidu)
  • ClickHouse

7. Distributed Storage:

Common choices: Ceph, HDFS, GlusterFS, GFS—selected based on specific use cases.

Currently, Ceph and HDFS dominate the market:

  • Ceph: Supports block storage, object storage, and file systems; widely adopted by cloud providers. It integrates well with OpenStack and Kubernetes.
  • HDFS: Ideal for massive data storage, often paired with Hadoop and Spark. However, its support for cloud-native environments is limited.

II. Self-Built CDN vs. Commercial CDN?

1. Choosing Between CDN Options

Deciding between self-building a CDN or using a commercial one depends on your company’s scale, cost constraints, and operational needs.

  • For general static file acceleration, if traffic is under 10M PV/month, avoid self-building—commercial CDNs suffice. Prioritize vendors offering low cost and strong performance.
  • For large file downloads, if your bandwidth is constrained, don’t build your own CDN—stick with commercial options.
  • For audio and on-demand video acceleration, if your R&D team lacks expertise, opt for commercial CDNs with wide node coverage, low pricing, and proven results.
  • For live streaming, where user experience is critical, prioritize CDN providers with excellent network quality across their edge nodes—preferably major cloud-based CDN vendors.
  • For dynamic acceleration and security acceleration, choose vendors with robust origin-pull paths and mature security mechanisms.

2. How to Build Your Own CDN?

  • Hardware: Select servers with high cost-performance ratios—focus on disk, memory, and CPU specs.
  • Data Center Bandwidth: Partner with telecom agents. Prefer data centers with:
    • High outbound capacity
    • Excellent network links
    • Strong DDoS protection
  • Cache Nodes: Choose from Nginx, Apache Traffic Server, Varnish, Squid.
  • Routing System: Use third-party intelligent CDN solutions. If you have strong R&D capabilities, consider Bind View or Bind DLZ.
  • High Availability & Load Balancing: Options include LVS, Nginx, Keepalived, HAProxy.

3. How to Choose a Commercial CDN?

Domestic CDN Providers: Alibaba Cloud, Tencent Cloud, NetEase Cloud, Huawei Cloud, Baidu Cloud, Kingsoft Cloud, White Mountain Cloud, Qiniu Cloud, Blue Network, UpYun, Dalian, UCloud, QingCloud, etc.

International CDN Providers: AWS CloudFront, Akamai, Google Cloud CDN, Fastly, Limelight, Cloudflare, StackPath, CDNetworks, etc.

When selecting a CDN provider—domestic or international—consider these metrics:

Metric Evaluation Criteria
(1) Node Distribution More nodes closer to users → better acceleration
(2) First Screen Time Shorter loading time → better UX
(3) Node Latency Lower latency → better network path
(4) Download Speed Faster download → strong server + network performance
(5) Packet Loss Rate Low loss → stable end-user connectivity
(6) Origin Pull Rate Lower ratio of origin requests/traffic → better offloading
(7) Hit Rate Higher hit rate → more cached content → better performance
(8) Platform Features Rich functionality, complete features, good UI/UX
(9) Support Responsiveness How quickly the operations team responds and resolves issues
(10) Routing Strategy Evaluate whether the vendor’s routing logic is rational and effective

III. Summary

In recent years, with the rise of cloud computing, China’s CDN industry has undergone significant consolidation. Former giants like NetEase Cloud and Blue Network have been largely overtaken by Alibaba Cloud and Tencent Cloud. Once-prominent Dalian’s business has declined, Kuaiwang was acquired by CenturyLink, White Mountain Cloud has pivoted toward edge computing, while mid-tier players like Kingsoft Cloud, UCloud, Qiniu Cloud, UpYun are gradually capturing market share.

In conclusion, the future direction of the CDN industry remains uncertain. But current trends show all major vendors aggressively investing in edge computing. With advancements in 5G, AI, and containerization technologies, CDN is no longer just a standalone technology—it must continuously integrate with other innovations and ultimately serve real-world applications in our daily lives.