Dynamic applications refer to c/c, php, Java, perl, Network application software developed in server-side languages such as .net, such as forums, online photo albums, dating, BLOG and other common applications. Dynamic application systems are usually inseparable from database systems, cache systems, distributed storage systems, etc.
The large-scale dynamic application system platform is mainly aimed at the underlying system architecture established for large-traffic, high-concurrency websites. The operation of large-scale websites requires the support of a reliable, secure, scalable, and easy-to-maintain application system platform to ensure the smooth operation of website applications.
Large-scale dynamic application systems can be 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
Structural diagram:
In order to achieve server sharing for different applications, avoid single points of failure, centralized management, unified configuration, etc., servers are not divided by applications, but all servers are used uniformly. Each server can provide services for multiple applications. , when the number of visits to certain applications increases, the performance of the entire server cluster can be improved by adding server nodes, and other applications will also benefit. The Web front-end system is based on virtual host platforms such as Apache/Lighttpd/Eginx, etc., and provides PHP program operating environment. The server is transparent to developers and does not require developers to intervene in server management
Load balancing systems are divided into two types: hardware and software. Hardware load balancing is highly efficient but expensive, such as F5 and so on. Software load balancing systems are less expensive or free and less efficient than hardware load balancing systems, but they are sufficient for websites with average or slightly larger traffic, such as lvs and nginx. Most websites use a combination of hardware and software load balancing systems.
Structural diagram:
Since the Web front-end adopts a load balancing cluster structure to improve the effectiveness and scalability of the service, the database must also be highly reliable to ensure the high reliability of the entire service system. How to build a highly reliable system that can provide large-scale services? Database system for large-scale concurrent processing?
We can use the solution shown in the picture above:
1) Use the MySQL database. Considering the characteristics of Web application databases that read more and write less, we mainly optimized the reading database and provided dedicated reading and writing databases. Database, read operations and write operations are implemented in the application to access different databases respectively.
2) Use the MySQL Replication mechanism to quickly copy the database of the master database (writing database) to the slave database (reading database). One master database corresponds to multiple slave databases, and data from the master database is synchronized to the slave databases in real time. Dumpling machine www.yjlmj.com Organized and released
3) There are multiple writing databases, each of which can be used by multiple applications. This can solve the performance bottleneck problem and single point of failure problem of writing database.
4) There are multiple reading databases, and load balancing is achieved through load balancing equipment, thereby achieving high performance, high reliability and high scalability of the reading database.
5) Separate database server and application server.
6) Use BigIP for load balancing from the database.
Caching is divided into file cache, memory cache and database cache. The most commonly used and most efficient method in large-scale web applications is memory caching. The most commonly used memory caching tool is Memcached. Using the right caching system can achieve the following goals:
1. Using the cache system can improve access efficiency, improve server throughput, and improve user experience.
2. Reduce the access pressure on the database and save set server.
3. There are multiple Memcached servers to avoid single points of failure, provide high reliability and scalability, and improve performance.
Structure diagram:
The storage requirements in the Web system platform have the following two characteristics:
1) The storage capacity is large, often reaching a scale that a single server cannot provide, such as photo albums, videos and other applications. Therefore, professional large-scale storage systems are needed.
2) Each node in the load balancing cluster may access any data object, and the data processing by each node can also be shared by other nodes. Therefore, the data to be operated by these nodes can logically only be A whole, not independent data resources.
Therefore, a high-performance distributed storage system is a very important part for large-scale website applications. (A brief introduction to a distributed storage system needs to be added here.)
Structure diagram:
With the continuous increase in website access traffic, most network services are provided externally in the form of load balancing clusters. With the expansion of cluster scale, the original server management model based on a single machine 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 planned tasks in batches.
There are some excellent software among distributed server management system software, 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. It is based on the C/S structure. All server configuration and management script programs are saved on the Cfengine Server, and the managed server runs the Cfengine Client program. The Cfengine Client regularly sends requests to the server through an SSL encrypted connection. Get the latest configuration files and management commands, scripts , patch installation and other tasks.
With Cfengine, a centralized server management tool, we can efficiently implement large-scale server cluster management. The managed server and Cfengine Server can be distributed in any location. As long as the network can be connected, rapid automation can be achieved. manage.
Structure diagram:
With the continuous increase of website access traffic, most network services are provided externally in the form of load balancing clusters. As the cluster size expands, in order to meet the batch distribution and update of program code in the cluster environment, we also A program code publishing system is required.
This publishing system can help us achieve the following goals:
1) The server in the production environment provides services in the form of a virtual host, which does not require developers to intervene in maintenance and direct operations. The release system can be used to distribute programs to the target server without logging in to the server.
2) We need to realize the management of the four development stages of internal development, internal testing, production environment testing, and production environment release. The release system can intervene in the code release at each stage.
3) We need to implement source code management and version control, and SVN can achieve this requirement.
Here you can use the commonly used tool Rsync to achieve code synchronization distribution between server clusters by developing corresponding script tools.