Scalability Design of Website Systems: Architecture and Load‑Balancing Strategies
This article explains how website systems achieve scalability through architectural designs such as physical function separation, server clustering, various load‑balancing techniques, distributed cache mechanisms, and both relational and NoSQL database scaling methods, providing practical guidance for large‑scale web deployments.
The scalability of a website system relies on using server clusters and continuously adding servers to increase processing capacity, expanding both site and server scale.
1. Scalability Design of Website Architecture
Two approaches exist: physical separation of functions (different servers host different services) and clustering a single function across multiple servers.
1.1 Physical Separation of Different Functions
Vertical separation (layered deployment) and horizontal separation (module‑level deployment) both achieve scalability by isolating business components.
1.2 Scaling a Single Function via Cluster Size
Instead of a stronger single server, multiple servers share the load, forming application‑server clusters and data‑server clusters (cache and storage).
2. Application Server Cluster Scalability
Load‑balancing servers detect cluster changes and distribute HTTP requests accordingly.
2.1 HTTP Redirect Load Balancing
Uses a standard server to compute the real backend address and returns a 302 redirect; simple but adds latency and may be penalized by SEO.
2.2 DNS‑Based Load Balancing
Multiple A records are configured; each DNS query returns a different IP based on a balancing algorithm, though caching can limit control.
2.3 Reverse‑Proxy Load Balancing
Operates at the application layer, forwarding requests after caching resources; simple deployment but can become a bottleneck.
2.4 IP Load Balancing
At the network layer, the balancer rewrites packet destination IPs based on algorithms, optionally using SNAT or acting as a gateway.
2.5 Data‑Link‑Layer Load Balancing (DR)
Modifies MAC addresses only, using a virtual IP shared by the cluster; Linux Virtual Server (LVS) is a common open‑source solution.
2.6 Load‑Balancing Algorithms
Common algorithms include round‑robin, weighted round‑robin, random, least connections, and source‑IP hashing.
3. Distributed Cache Cluster Scalability
Cache servers store different data; new nodes must quickly obtain relevant data while decommissioned nodes may still hold hot data.
3.1 Memcached Access Model
3.2 Consistent Hashing with Virtual Nodes
Using a hash ring maps keys to servers; adding virtual nodes reduces data movement when scaling.
4. Data Storage Server Cluster Scalability
4.1 Relational Database Cluster Scaling
Replication, master‑slave read/write splitting, and sharding (data partitioning) are used; products like Cobar provide a proxy layer for MySQL clusters.
SQL routing splits queries to appropriate MySQL instances, merges results, and returns a unified response.
4.2 NoSQL Database Scaling
NoSQL systems (e.g., Apache HBase) sacrifice SQL and ACID for high availability and horizontal scalability.
—
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
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.