Experience of large-scale Internet website architecture II: and, for other

Source: Internet
Author: User

LastThe "points" is a relatively large principle and a relatively high-level principle. This time I want to talk about the other two principles: and change.

 

And

 

Why? It is because we want to improve the system's load-carrying capability by dividing. What is that? I thought about the following aspects:

 

1.Merge user requests.CSS/Image/Script, you can also merge pages. However, merging may result in a waste of traffic and requires a balance point.

2.The granularity of the merge interface. For distributed applications, we may not directly access the database but call the interface provided by the application layer. Because it is a network call, the cost is relatively high, therefore, when designing an interface with coarse granularity, we should try our best to provide a coarse-grained interface. A single call will return a large amount of data, instead of refining the interface to add, delete, and modify layers.

3.For the deployment of merged interfaces, data redundancy can be considered for frequent cross-machine calls, so that cross-network service programming processes can communicate or even be transferred to the client. For example, you can directly call the interface provided by the application layer (cross-machine) to filter dirty words when posting a forum. However, this interface can be used at a high cost.IPCDeployed on the local machine.

 

Change

 

Time for space and time for space are common practices. Specifically:

 

1.Cache. The importance of caching is early in computer hardware. For websites, there are many types of caches, which can be the client resource cache, the page output cache, or the application layer data cache, with the same purpose, it can reduce the number of server requests, the request processing process, or the number of database accesses. Of course, generating static files can also be regarded as a cache. It is impossible not to access a disk, but we need to greatly reduce the disk access opportunities.

2.Sometimes, in order to obtain extremely fast responses, we will use repeated computing at any cost. For example, a certain operation may slow the response due to network problems or other reasons, and a unified processing interface can be provided during the design, the interface is distributed to different servers for asynchronous implementation of this operation. When the server returns the result, we use this result and then kill the redundant operations of other servers.

3.Websites generally want to respond quickly. Generally, they do not use time for space at a relatively high level.AlgorithmThe space saving problem may still be considered.

4.Sometimes we use some aggregate tables to store aggregated data, that is, pre-calculation to Improve the Performance of complex computing (such as reports. Of course, building a multi-dimensional database for data analysis is also a good choice.

 

A lot of netizens commented that there was nothing specific about it. I think it is difficult to say how to implement the architecture. Because the implementation depends on the situation and there is no perfect thing, the architecture is usually balanced, it is very likely that the implementation of the architecture will be affected by a different emphasis. Hope that myArticleI can give you a tip. After reading this, If you think "I didn't take this into consideration, please pay attention to it later", it may be the greatest help, next I would like to talk about some other problems, each of which is scattered. It is a supplement:

 

1. whether to adopt the existing things or do it by yourself needs to be considered in detail. using other things may be relatively stable, but your own control is less, you can use your own things flexibly, but there may be many problems. In any case, when we adopt a third-party framework, we must conduct a thorough investigation to see its shortcomings. Otherwise, the project may be restricted by this framework in the future. Otherwise, when you decide to build a framework, you need to see what other frameworks cannot provide.

2.Data can be compressed during data transmission, but the compression and decompression requirements must be taken into account.CPUResource, inIo(Disk, bandwidth, transmission capacity) andCPUThere is a balance between them.

3.The ideal scalability architecture allows you to add or replace servers without downtime or great adjustments. When using a unified scheduling center to schedule these servers and allocate requests, we need to consider how much traffic the scheduling server can withstand.

4.Is there a large number of cheap servers or a small number of high-end servers? How to combine servers to maximize their role as needed.

5.For the distributed architecture, we try to keep every node simple logic and minimize the dependencies between nodes at the same level. A unified place is required to manage all nodes.

6.Function Decomposition, asynchronous integration, failover, and failure protection.

7.The architecture upgrade of software is very similar to that of computer hardware. For a period of time, we are slowly improving our overall capabilities,2After several times, we found that only a thorough architecture change can improve our capabilities by dozens of times. After the upgrade, we may encounter other problems. Just likeCPUTo improve the clock speed or completely change the architecture.

8.In terms of data, read/write splitting, database separation, functional division, caching, and mirroring.

9.The architecture on the hardware network is very important, but some details in software development cannot be ignored. A good architecture does not mean no needCodeReview.

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.