Architecture and the nature of architecture as I understand it

Before I get to my understanding of the nature of architecture, let me give you a personal insight into the topic of today’s Tech Salon. A ten-million-scale website feels like an order of magnitude, an order of magnitude that needs to be strategically and tactically treated with disdain. Let me give you an example of what the order of magnitude is. Okay? According to the information released by the media, Uber receives about one million orders on average every day. If it has 10 hours of service every day, its average QPS is only about 30. For a background server, the average QPS of a single server can reach 800-1000, so it is very simple to see the volume of write traffic alone. Why can’t we say we despise it? First, if we look at its data storage, a million a day, what is the size of the data volume a year? Secondly, the order quantity just said, each order should be pushed to the nearby driver, the driver should be combined

The page views of the back business scenes are often hundreds of times those of the former, easily exceeding hundreds of millions of levels.

What I want to do today is start by talking about the nature of architecture, and I want you to understand the starting point and the problem that it solves when you do some constructive design.

The first explanation of the structure is what I saw from Zhihu. What is architecture? Some people say that architecture is not a very dangling thing, but actually a shelf to put some businesses and algorithms, just like the clothes hanger in our life. To be more abstract, the architecture is really an abstraction of our repetitive business and a vision of our future business, emphasizing past experience and your vision of the industry as a whole.

What capabilities do we need to build an architecture? I think one of the most important things about being an architect is that you have to be able to break down strategy. How to look at this:

First, you have to have the ability to abstract, and the ability to abstract is basically the ability to de-emphasize, and de-emphasize is embodied in all aspects of the architecture, from defining a function, to defining a class, to providing a service, to providing templates, all of which is to de-emphasize to improve reusability.

Second, classification ability. To do software needs to do object decoupling, to define the attributes and methods of the object, to do the distributed system to do service separation and modularization, to define the interface and specification of the service.

Third, algorithm (performance), its value is reflected in improving the performance of the system, all performance improvement, will eventually fall into the CPU, memory, IO and network these four blocks.

This PPT page gives some examples to further understand the architectural ideas behind common technologies.

The first example, in the distributed systems and we will do the MySQL database table, we should from different libraries and read the data in the table, the abstract is the most intuitive to use the template, because the vast majority of SQL semantics is the same, in addition to routing to which libraries which table, if you don’t use the Proxy middleware, template method is the most valuable.

Second, let’s look at the CDN of accelerated network. It is to improve performance in terms of speed. Just now, we have mentioned that from the four aspects of CPU, memory, IO and network, CDN is essentially to optimize intelligent network scheduling and multi-level cache.

The third look at the servitization, just mentioned, each big website transformation process will do servitization, in fact, it is to do abstraction and service separation. Fourth, take a look at message queues, which are essentially categorized, but instead of two well-defined classes, two well-defined subsystems are deconstructed and asynchronized through queues.

What is the overall structure of Sina Weibo

Next, let’s take a look at the overall architecture of Weibo. When the system reaches a certain level, the entire architecture will become three layers. The clients include WEB, Android and IOS, but I won’t mention it here.

It is followed by an interface layer that serves three main purposes:

The first function is security isolation, because front-end nodes interact directly with users and need to guard against various malicious attacks.

The second one also acts as a flow control function. As we all know, during the Spring Festival of 2014, wechat red envelope received more than 800 million requests per minute. In fact, the number of requests actually reached its background was only about 100,000 (the data may not be accurate here), and the remaining traffic was blocked at the interface layer.

Third, we see different requirements on the PC side and the mobile side, so we can split it. After the interface layer is the background, it can be seen that there are three big pieces of microblog background:

One is platform services,

Second, search,

Third, big data.

All kinds of services in the background are actually processing data. Like the business department of the platform, do is data storage and read, for search to do data inspection, for big data is to do data mining. Micro blog is actually very similar to Taobao

Micro blog is actually very similar to Taobao. Generally speaking, the first-generation architecture can basically support users to millions of levels, while the second-generation architecture can basically support tens of millions of levels. When the business scale reaches hundreds of millions of levels, the third-generation architecture is needed.

From the LAMP architecture to the service-oriented architecture, there are several difficulties. First of all, it is impossible to meet the rapid growth of users through simple tinkering on the basis of the first generation, and online business cannot stop at the same time. This is what we often say about changing engines on airplanes. A few days ago, a friend of mine asked me that when he was implementing servitization internally, he had completed the servitization of one module, but other departments refused to accept it. I suggest doing it in the service, is the first more biased towards business, to find a proper breakthrough point a good at the same time, both the architecture and service promotion, business also should have benefits, such as improve performance or decrease the cost of maintenance and upgrade process is smooth, suggest start from atomization services, such as the basis of user service, short message service, Basic push services. Second, it can be used to do stateless service, which will be discussed in detail later. Moreover, data Sharding is needed when the amount of data is large, which will be discussed later. The problems to be solved in the third generation architecture are that the number of users and businesses tend to increase steadily (exponential growth relative to the outbreak period), more consideration is given to the stability of the technical framework, to improve the overall performance of the system, to reduce costs, and to improve and upgrade the monitoring of the entire system.

conclusion

Using the Java language as an example, you must first understand Java; Second, after JAVA is finished, you must untangle the JVM. Second, understand the operating system; Thirdly, we need to understand the Design Pattern, which will tell you how to abstract and precipitate the past experience for future reference. You will also learn TCP/IP, distributed systems, data structures and algorithms.

Programmers must form their own set of architecture design principles and methods through continuous learning, practice and summary!

How to study together, are there free materials?

Welcome to Java architecture development: 697-579-751 for those who have worked in Java for one to five years

This group provides free study guidance framework materials and free solutions

If you don’t know any questions, you can ask them in this group. There will also be career planning and interview guidance