Dynamic applications, as opposed to static website content, refer to web application software developed with server-side languages such as C/C++, PHP, Java, Perl, .NET, such as forums, online photo albums, social networking, BLOG, and other common applications. Dynamic application systems are usually inseparable from database systems, caching systems, distributed storage systems, and so on.
The large-scale dynamic application system platform is primarily a low-level system architecture established for high-traffic, high-concurrency websites. The operation of large websites requires a reliable, secure, scalable, and easily maintainable application system platform as support to ensure the smooth operation of website applications.
Large-scale dynamic application systems can be further divided into several subsystems:
- 1) Web Front-End System
- 2) Load Balancing System
- 3) Database Cluster System
- 4) Caching System
- 5) Distributed Storage System
- 6) Distributed Server Management System
- 7) Code Distribution System
Web Front-End System
Structure diagram:
In order to achieve the goals of server sharing among different applications, avoiding single points of failure, centralized management, unified configuration, etc., servers are not divided by application. Instead, all servers are used uniformly, and each server can provide services to multiple applications. When the traffic to certain applications increases, adding server nodes improves the performance of the entire server cluster, and other applications will also benefit. This Web front-end system is based on virtual host platforms such as Apache/Lighttpd/Eginx and provides a PHP program runtime environment. Servers are transparent to developers, and developers do not need to be involved in server management.
Load Balancing System
Load balancing systems are divided into two types: hardware and software. Hardware load balancing is efficient but expensive, such as F5. Software load balancing systems are low-cost or free, and although less efficient than hardware load balancing systems, they are sufficient for websites with average or slightly higher traffic, such as LVS and Nginx. Most websites use a combination of hardware and software load balancing systems.
Database Cluster System
Structure diagram:
Since the Web front-end uses a load-balanced cluster structure to improve service availability and scalability, the database must also be highly reliable to ensure the high reliability of the entire service system. How can we build a highly reliable database system that can handle large-scale concurrent processing?
We can adopt the solution shown in the diagram above:
1) Use the MySQL database. Considering the characteristic of Web applications where database reads are more frequent than writes, we mainly optimized the read database by providing dedicated read databases and write databases, and implemented read and write operations in the application to access different databases respectively.
2) Use the MySQL Replication mechanism to quickly replicate data from the master database (write database) to slave databases (read databases). One master database corresponds to multiple slave databases, and data from the master database is synchronized to slave databases in real time.
3) There are multiple write databases, each of which can be shared by multiple applications. This can solve the performance bottleneck problem and single point of failure problem of write databases.
4) There are multiple read databases, and load balancing is achieved through load balancing devices, thereby achieving high performance, high reliability, and high scalability of read databases.
5) Database servers are separated from application servers.
6) Use BigIP for load balancing for slave databases.
Caching System
Caching is divided into file caching, memory caching, and database caching. In large-scale Web applications, memory caching is the most widely used and the most efficient. The most commonly used memory caching tool is Memcached. Using a proper caching system can achieve the following goals:
1. Using a caching system can improve access efficiency, increase server throughput, and enhance user experience.
2. Reduce access pressure on databases and storage servers.
3. There are multiple Memcached servers to avoid single points of failure, provide high reliability and scalability, and improve performance.
Distributed Storage System
Structure diagram:
The storage requirements in a Web system platform have the following two characteristics:
1) The storage capacity is very large, often reaching a scale that a single server cannot provide, such as applications like photo albums and videos. Therefore, a professional large-scale storage system is needed.
2) Each node in the load-balanced cluster may access any data object, and the data processing of each node can also be shared by other nodes. Therefore, the data that these nodes need to operate on can logically only be a whole, not independent data resources.
Therefore, a high-performance distributed storage system is a very important part of large-scale website applications. (A brief introduction to a distributed storage system needs to be added here.)
Distributed Server Management System
Structure diagram:
With the continuous increase in website traffic, most network services provide external services in the form of load-balanced clusters. As the cluster scale expands, the original single-machine-based server management model can no longer meet our needs. The new requirements must be able to manage servers in a centralized, grouped, batch, and automated manner, and execute scheduled tasks in batches.
Among distributed server management system software, there are some excellent programs, and one of the more ideal ones is Cfengine. It can group servers, and different groups can customize system configuration files, scheduled tasks, and other configurations separately. It is based on a C/S structure. All server configurations and management script programs are stored on the Cfengine Server, while managed servers run the Cfengine Client program. The Cfengine Client periodically sends requests to the server side through SSL-encrypted connections to obtain the latest configuration files, management commands, script programs, patch installation, and other tasks.
With a centralized server management tool like Cfengine, we can efficiently implement large-scale server cluster management. Managed servers and the Cfengine Server can be distributed anywhere, and as long as the network is connected, fast automated management can be achieved.
Code Release System
Structure diagram:
With the continuous increase in website traffic, most network services provide external services in the form of load-balanced clusters. As the cluster scale expands, in order to meet the batch distribution and update of program code in a cluster environment, we also need a program code release system.
This release system can help us achieve the following goals:
1) Servers in the production environment provide services in the form of virtual hosts, without requiring developers to be involved in maintenance and direct operations. The release system allows programs to be distributed to target servers without logging into the servers.
2) We need to implement management of four development stages: internal development, internal testing, production environment testing, and production environment release. The release system can be involved in code release at each stage.
3) We need to implement source code management and version control. SVN can fulfill this requirement.
Common tools such as Rsync can be used here, and by developing corresponding script tools, synchronized code distribution among server clusters can be achieved.
Source: http://blog.csdn.net/dinglang_2009/article/details/6863697