How to Achieve High Availability and Scale Your Web Application Efficiently
This article explains practical techniques for improving web service availability—such as static‑dynamic separation, CDN acceleration, distributed file systems, service decomposition, and database sharding—while minimizing code changes and addressing common scaling challenges.
High Availability Basics
After meeting basic performance requirements, the focus shifts to "availability" (often expressed as SLA or the number of nines). Ensuring true high availability is a difficult problem.
Most large‑scale internet companies use similar architectures, differing mainly in the number of nodes.
Static and Dynamic Separation
Separating static and dynamic resources is a common practice. This can be done with developer cooperation—placing static assets on a dedicated site—or without it, using a multi‑layer reverse proxy that determines resource type based on file extensions. Once a dedicated static file server is in place, storage becomes an issue; distributed file systems help keep files consistent across multiple servers when shared storage is unaffordable.
CDN Acceleration
Content Delivery Network (CDN) acceleration is widely used both domestically and abroad. It has become affordable and helps mitigate severe north‑south internet connectivity issues in China.
The basic principle of a CDN can be understood as intelligent DNS combined with Squid reverse‑proxy caching, requiring many data‑center nodes to serve requests.
Application Refactoring and Service Decomposition
So far, most solutions have not required major changes to the application architecture. However, as business complexity grows, a monolithic architecture leads to tight coupling, making development and maintenance difficult and causing "single point of failure" risks.
Consequently, many sites are split into separate sub‑sites, each hosted independently. This also allows vertical database partitioning to handle limited QPS, TPS, and I/O capacity of a single database.
Even after splitting applications and databases, duplicated logic across sites can arise. Common functionalities can be packaged into DLL or JAR libraries, but strong dependencies may cause versioning and dependency‑management problems, highlighting the value of Service‑Oriented Architecture (SOA).
When inter‑service dependencies become problematic, high‑throughput decoupling tools become essential.
Database Sharding and Table Partitioning
Large internet companies often employ database sharding and table partitioning. However, unless the business urgently demands it, this step should not be taken lightly.
While many can perform sharding, the real challenge lies in managing the system after the split. Currently, there is no completely open‑source, free solution that solves database partitioning problems once and for all.
Source: http://blog.csdn.net/dinglang_2009/article/details/46399293
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.
ITFLY8 Architecture Home
ITFLY8 Architecture Home - focused on architecture knowledge sharing and exchange, covering project management and product design. Includes large-scale distributed website architecture (high performance, high availability, caching, message queues...), design patterns, architecture patterns, big data, project management (SCRUM, PMP, Prince2), product design, and more.
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.
