Comprehensive Guide to Scalable Website Architecture from an Operations Perspective
This article presents a step‑by‑step operations‑focused roadmap for evolving a website from a single‑server prototype to a highly available, horizontally scalable architecture using load balancing, caching, database replication, service‑oriented design, DNS round‑robin, CDN, and disaster‑recovery techniques.
Many online articles discuss website architecture from different angles; this piece consolidates the operations viewpoint, describing how a mature site gradually gains high availability, scalability, and performance as traffic and business lines grow.
Applicable Business and Stack
Business: e‑commerce, portal, recruitment sites
Languages: PHP, Java
Web services: Nginx, Tomcat8
Database: MySQL
OS: CentOS
Physical servers: Dell R730/R430
1. Single‑Server Deployment
Initially the project is launched with minimal traffic on a single machine.
2. Separate Web and Database Servers
When traffic increases, HTTP and SQL workloads are split onto different servers to improve concurrency.
3. Early Static/Dynamic Separation
Static pages are deployed separately from dynamic ones to reduce load on application servers.
4. Database Master‑Slave and Redis Cache
MySQL replication (binlog‑based) and Redis caching are introduced to accelerate queries and reduce database pressure. Strategies for cache freshness include middleware routing, delayed eviction, message‑queue‑driven invalidation, and expiration settings.
5. Seven‑Layer Load Balancing, Shared Storage, and Redis HA
Layer‑7 load balancers forward traffic based on domain or suffix; NFS provides shared storage for code and static assets; Redis is deployed in master‑slave mode with Sentinel/Keepalived for high availability. Session persistence methods such as IP‑hash, session sharing, sticky sessions, and session replication are discussed.
6. Database Architecture Expansion
Master‑multiple slaves (asynchronous binlog replication)
Read‑write separation via application logic or middleware (e.g., Atlas, MyCat)
Sharding: database, table, and partition splitting to distribute I/O and improve performance
Four‑tier load balancing for slave databases using LVS and VIPs
7. Service‑Oriented Architecture (SOA)
Adopt Dubbo for RPC, ZooKeeper as a configuration center, and RabbitMQ for decoupled messaging.
8. DNS Round‑Robin and Full‑Text Search Engine
DNS load balancing distributes requests across multiple IPs; full‑text engines like Elasticsearch or Sphinx provide fast search over large product catalogs.
9. Static Cache Server
Static resources are cached at the edge to bypass backend web nodes and NFS, reducing latency.
10. Distributed File System and CDN
When NFS limits are reached, a distributed file system (DFS) offers higher performance and scalability; CDN caches static content globally to accelerate user access and lower origin load.
11. Four‑Layer Load Balancing and NoSQL
Layer‑4 load balancing offers higher throughput for pure forwarding; NoSQL databases address scenarios with massive, unstructured data that are hard to optimize in relational stores.
12. Elastic Scaling, Microservices, In‑Memory Processing, and Disaster Recovery
Automatic scaling adds or removes nodes; microservices break applications into lightweight, independently deployable units; critical data is kept in memory when possible; multi‑site replication ensures continuity.
13‑14. Emergency Plans and Response Strategies
Define system tiers, perform full‑link analysis, implement comprehensive monitoring, draft and rehearse incident response procedures, and outline specific actions for network, proxy, application, cache, and data layers (e.g., VIP switch, IP rate limiting, thread‑pool tuning, Redis/MySQL failover).
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.