Basic website architecture diagram, architecture Diagram

Source: Internet
Author: User
Tags server array

Basic website architecture diagram, architecture Diagram
Basic website architecture Diagram


Original content are welcome to reprint, please indicate the source: http://dushii.blog.163.com/blog/static/17305193200883044111183/
Basic website architecture diagram:
For reference only. This architecture is applicable to applications with only a few servers. portal applications must be much more complex.

This graph is drawn by an expert of the billion graph. This graph software is recommended.

Main contradictions
For high-concurrency website systems, the first problem exposed is the database bottleneck, and the super database system will soon become the bottleneck of access speed. Therefore, the first bottleneck to improve access speed is database access. The policy is
I. cache:
1. Squid front-end cache;
2. Memcached backend cache;
3. Create an external index file, such as sphindexing;
Ii. database server array:
1. Separate database read/write operations into Master/Slave servers;
2. The master and slave servers are configured as arrays according to certain rules;

In short, we should minimize the number of requests to the database and further use Server Load balancer to minimize the pressure on a single server.

Reasons for using Nginx for load balancing:

Details
After the client enters the domain name in the address bar of the browser, it will first access the front-end proxy server. static text files are directly returned by this server. A separate image server is set up here, suitable for websites with many images. Proxy a part of a specific url to the backend Squid server. The Squid server checks whether there is cached content based on the url address. If yes, it returns it to the front-end server. Otherwise, it will access the backend php application, obtain and cache the content for next access. The Squid server can be one or an array organized according to certain rules.

The PHP application can also be an array or an array. The case for a single server is relatively simple. For an array, the session on the client needs to be considered. The solution is as follows:
1. the array server shares session calls. For example, memcached is used to store sessions;
2. The front-end server can determine which php server the client belongs to and always proxy the client to the php application;

Compared with the two methods, the second method may be more appropriate in the long term from the scalability perspective. For clients that access the php application for the first time, the round robin rule is used for load balancing. php sets a cookie flag for the client. For the second access, the cookie information is linked to the previous php application.
For example, if you set the cookie information host = n and n to a number, nginx can obtain the cookie information string of the client,
Upstream backend {
Server backend1.example.com weight = 5;
Server backend2.example.com: 8080;
}

If ($ http_cookie ~ * "Host = ([^;] + )(? :; | $ )"){
Proxy_pass http: // 192.168.0. $1;
} Else {
Proxy_pass http: // backend;
}

For more information about memcached data caching, sphinx site search, and mysql master-slave array.
It will be supplemented later.

Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.