Typically, a site's architecture comes with functional requirements, and the following five aspects should be considered:
Performance
Availability of
Elasticity of
Scalability
Security
The official explanation of performance performance, I will not say. To the user, is the system reaction speed is fast.
For Web sites, performance issues are ubiquitous, and then there are a number of ways we can optimize performance.
We used to go to the next one.
In the browser side, can be through the browser cache, page compression, reasonable layout of the page and other ways
You can also use a CDN, so that some static files in the Network Service room, so close to the user.
You can also use a reverse proxy to put static files on a reverse proxy server, such as Apache
Server side is cache, there are local cache, distributed cache two forms
Then there is the asynchronous, cluster
The above is a server-level approach
At the code level, multithreading can be used to give full play to the benefits of multicore
Database hierarchy, indexing, caching, SQL optimization and so on, the database service providers have done for us.
The site's performance metrics include
Response time (a good understanding)
TPS (Transaction per Second) The number of transactions or transactions that the system can process per second
As for my personal understanding, the corresponding performance optimization, should first Test, to understand the system is where the slow, where is the bottleneck of the system. Optimize the time to be targeted, can not be wasted.
Analysis and testing of performance the next section we'll talk about.
Usability This is also relatively good understanding, can be used to say, the system as a whole can provide services to the outside.
Because to maintain the code, add new applications or hardware problems, power outages and so on, no one site can do 7x24 hours available.
However, we have to do our best to be highly available.
The main means of high availability is redundancy. A hardware capable thing, I use N (n>1) A.
Application server uses n, with load balancing, one bad and N-1 station. Of course load balancer this thing, can also deploy 2 sets.
The corresponding database, is usually a real-time backup.
Measuring whether a system's architecture is designed to meet a high-availability goal is to assume that the overall system is still available if any one or more servers in the system are down, or if there are other unforeseen problems.
Scalability we already know that in the current practice, the Web site is to use multiple servers to form a whole to provide services externally (can be used as application services, storage services, of course, computing services, etc.).
The measure of scalability is the time when multiple servers can be used to build the cluster, whether (easy) to add more servers to the system to improve the service capability of the system, the total number of servers in the cluster is limited.
There are three main servers, application server, cache server, database server.
For the application server, only the data is not stored inside, then all the servers are equivalent, as long as there is a suitable load balancing policy, we can continue to increase the application server.
Cache server, (if the app already relies heavily on caching) The main contradiction here is to improve the caching of the routing algorithm (otherwise, the route will fail)
Database to directly increase the hardware to expand the service is cumbersome, so here our main strategy through the routing partition of multiple databases deployed to the cluster of servers.
NoSQL itself is the result of big data, and scalability is better.
Scalability and extensibility in the literal sense, it seems very close
In fact, the extension, refers to the existing system to add a new module, whether it can achieve the existing module transparency without impact, do not need or rarely change the existing code will be able to launch new modules, different products are rarely coupled, a product changes to other products have no impact.
To achieve scalability, mainly by two means 1 event-driven 2 distributed services (in fact, to decouple, that is, these two ways)
Event-driven refers to the introduction of Message Queuing in the system
A distributed service separates the business principal from the service that can be reused. New products can invoke reusable services to implement their own logic.
Security
Protected from malicious access and attacks, important data is not stolen.
Mind Mapping
Technical architecture of large Web sites reading notes 2 large Web site core architecture elements