Do not understand the essence of architecture, how can you create an orderly system?

 

Now software systems become more complex, of course, accordingly, the role of architecture has become increasingly evident. As developers, we are dealing with every day and architecture, in the process, for architecture is also often produce a variety of issues:

  • What is architecture? What are the classification schema, respectively, to solve the problem?
  • What is a good architectural design? How can I grow it as a good architect?

These issues relate to our understanding of the architecture, but also begin to learn and use architecture. So, today, we have to analyze in depth the essence of architecture, so you can thoroughly understand it.

The essence of architecture

Physics has a very well-known "law of entropy increase": a closed system, all from order to disorder, that is, its entropy (ie, disorder degree) will continue to increase, the system will eventually become completely disordered .

On this theory on the evolution of software systems, it is also very suitable.

On the one hand, with the increasing business needs, we will continue to add business functionality to the system; on the other hand, with the increasing traffic, we will continue to enhance the system non-operational functions through technical means. If you do not do well in advance of design, with the advance of time, the entire system is barbaric growth, will gradually fragmented, more and more chaotic, eventually reinvent the wheel.

However, the nature of organisms can interact with the outside world, active metabolism, manufactured by "negative entropy", that is, reduce clutter, to ensure their orderly, continue to survive. For example, plants through photosynthesis, light energy, carbon dioxide and water in organic synthesis, in order to nourish themselves, continue to survive. For software systems, we can also take the initiative to adjust the relationship between the various parts of the system, ensure the overall orderly system to better accommodate the growing business and technological change. Adjust the internal relations of such a system is implemented by the architecture, so the architecture is essentially:

By reasonable internal layout, ensure highly ordered system, capable of expanding to meet changing business and technology.

This contains two meanings, we specifically said that under the expanded:

First of all, the starting point is the architecture of business and technology in increasingly complex, causing a system panic, need to ensure the orderly through architecture. We know that the word comes from the construction industry, architecture, why the construction industry needs "framework" mean?

Build a straw house is very simple, you can directly get started; building a cover layer 2, a little more complex, but under the guidance of experienced craftsmen, the problem is not large; and build a high-rise complex is quite different, and we need to consider internal structure, load-bearing, lighting, drainage, seismic lightning, etc., which require professionals well in advance of the overall architectural design, and strictly in accordance with the design to construction.

Here, you can see that the building's architecture is not natural there, but because the building more and more complex, we need to manage this complexity through architecture, to avoid loss of control of the construction process.

The same is true of software systems, from simple desktop application to today's large Internet platform, the process, the increasing scale of the system, business and technology have become increasingly complex. We also need to architectural design, digestive disorders caused by the complexity of the system is always in an orderly state, able to respond to current and future needs change.

Secondly, the architecture achieved from disorder to order, is achieved through rational internal layout, the basic means is the "Separation" and "together", first system to break up, then recombine them to form a more reasonable relationship .

 

 

Specifically, the "sub" system is to be split into subsystems, modules, components. Split time, we must first solve the problem of locating each part, and then based on location, divided from each other's borders, and finally achieve a reasonable split, we are more familiar micro-service architecture, it is a typical split approach.

"Integration" is based on business processes and technology, the organic integration of the various components together. For example, the service platform in the micro-architecture, the split into specific micro-services, we need to classify these services and stratification, some belonging to the underlying service, some belonging to the upper aggregation service, but also to implement the service as much as possible , such as we said recently in Taiwan, which are reflected in the idea together.

This points to the complexity of the process of co-decomposing systems into two levels:

  • First, each subsystem independently assume responsibility, contains its own internal complexity. Subsystem complexity is transparent to the outside, the outside do not care.
  • Secondly, the subsystem through the package, reduced to a clear responsibility of a point, therefore, we need only during closing in, resolve dependencies between various points, so you can define the system as a whole.

For example, we all know that the 23 GoF design patterns, the Builder mode, its main logic only needs to be given to the various components of the assembly, it does not care to create a specific component of the internal logic, this can pay to the factory model to achieve. Here, Builder mode is responsible for assembling logic coarse-grained, it is bound to bear part; factory mode logic responsible for fine-grained structure, assume that the sub-section, we each manage their own complexity.

By reasonable "Separation" and "together", the system is not back to square one, but the original monolithic structure of the system becomes a flexible system. Thus, the complexity of the system decomposition of the effective and orderly of the system greatly enhanced.

Of course, the complexity of the system are many, there are technical and on the business architecture is a system, there will be a variety of architectures together to deal with these complex challenges. So then, we come to the specific look.

Category Architecture

According to different angles, architecture can have a lot of classification, but in general, divided into business architecture, application architecture and technical architecture. So, these architectures are serving whom, to solve the problem, what is the relationship between each other it?

Before answering these questions, we first look at the system of landing process.

The system first be developed by people, then run by the machine, and the machine ground to participate in a system.

 

 

For the person responsible for the development, the more troublesome is that the business is too complicated, mind to think clearly, even if the current force the business logic into the code, system maintenance is also a follow-up question. Thus, the developer is required system concept is clear, readily be understood that business logic, code development visually.

Responsible for running machines, troublesome is complicated by external request is too large, causing the machine could not carry, sometimes, the hardware will go wrong. Therefore, it requires a system is capable of expansion, support for hardware fault tolerance, high performance and ensure system availability.

Here, the development of major pain points to be resolved by the application architecture and business architecture, the machine's main pain points by the technical infrastructure to solve.

Why do you say? We look, these architectures are specifically what to do with.

In simple terms, the business structure is clear core business processes, define the relationship between the various business modules, it helps us understand what the system is facing and how to deal with from a conceptual level; and application architecture that is clear is how the organization's internal systems , what applications is how to call each other, and it helps us to understand how the internal system of division of labor and cooperation from the logical level.

Technical architecture is clear which system consists of hardware, operating system and middleware, which are the applications we develop and how fit together, to deal with a variety of unusual circumstances, to maintain stability of the system are available. So, technology architecture from the physical level to help us understand how the system is structured, and how to solve the problem of stability.

Here you can see, business architecture, application architecture and technical architecture, define a system from concept, logical and physical levels. Business architecture gives business division and dependency relationship module, which also roughly determine how the division of labor and collaboration applications, of course, does not require strict correspondence, such as a commodity business, it may correspond to three applications, a merchandise display foreground application, a background merchandise management applications, as well as a basic commodity service, but this does not affect us understand logically, a business scenario, which applied to participate, and how they cooperate.

The technical architecture of it, by stabilizing operations support applications, and ultimately ensure business no problems. For example, when the big promotion, multiple applications may be affected by a large flow impact, we must consider how technology architecture through technical means to protect the related application capable of handling high concurrency, so as to ensure the smooth progress of big promotion.

Here, I give an example of making movies, to help you more intuitive understanding of the relationship of these three architecture: Business Architecture defines the storyline of this movie and scene arrangements; application framework to further define what roles, each of which duties, and in each scene, how these roles interact; technical architecture to finalize who will perform these roles, the physical layout of the scene is how, in order to ensure the successful completion of the entire shooting.

Finally, I want to emphasize: The system is a human system architecture is the first serving others. Therefore, the business concept is clear, rational use of division of labor, understanding that good people first. We then consider the issue of technology selection, to ensure the realization of the system non-functional objectives. So when do the architecture design, the general is to consider the business architecture, application architecture and then, finally, technology architecture.

What is good architecture?

From the above, we can see that a good architecture must meet two challenges: the complexity of the business and technical complexity.

1. The complexity of the business

The system must first meet current business requirements, on this basis, but also to meet future business needs, so the system should be able to continue to expand changes, including adjustments to existing features, and add new features.

Moreover, the system can not function changes affect existing business, not a modification, it led to launch a body, a problem everywhere. Therefore, in the framework design, to make the system flexible scalable, flexible and able to make adjustments according to changes in the business.

In addition, the market waits for no one, on the new business to be fast, before spent six months on a business, this time again on a similar new business, we need to be able to fall short time. Therefore, the framework design, but also to achieve the system functions can be reused, so as to reuse through rapid, business agility and innovation.

2. Technical complexity

To ensure the normal operation of a business, in addition to meet business functions, but also to ensure that this system is stable and usable.

A complex system is composed of many components, such as applications, servers, databases, networks, middleware, are likely to go wrong. That how when things go wrong, can quickly restore the system or backup system on top let go?

There are traffic problems, traffic usually is not, the machine can handle a small amount, but when the big promotion, a lot of traffic coming in, the system is not able to be able to support the machine by simply adding way?

There are also low-cost problem, the system can do, instead of using cheap equipment IOE equipment on tall, free use of open source components instead of expensive commercial packages, using virtualization technology rather than physical machines, and low in traffic and peak at different times, so that the system can be elastically volume reduction and expansion of it?

These are technical challenges to solve the system of non-operational functions, it is also designed to support the architecture.

Therefore, a good design should not only meet business architecture scalable, reusable; we need to meet high availability systems, and high-performance scalable, cost-effective manner and as far as possible landing. So, for architectural designs, technology and business both hands grasp with both hands.

So, a good architect needs to have what kind of ability, in order to design a good structure?

What is a good architect?

A good architect should have a strong comprehensive ability to internally and externally, "under the kitchen, the living room," Here I come by way of the typical architecture, the ability to introduce a good architect should have:

 

 

A driving school instructor, driving skills must be good; a swimming coach, certainly a good level of swimming, because these are very practical work. The same architect, TA must be a good programmer to write code for a good hand.

On this basis, the architect must have the breadth of technology (multi-domain knowledge) and depth (technology foresight). The company's mainstream system design is very understanding, knows the merits of the length of the face of practical problems, we will soon be able to offer a variety of programs for evaluation.

In addition, architects need to have a high degree of thinking, with abstract thinking ability. Abstract thinking ability is the most important architects, architects should be good to kind conceptualized and categorized. For example, the face of a large-scale B2C website, can quickly sourcing abstract -> Operations -> Front Search -> Order -> Single fulfill these major modules of the system divide and rule.

Architects also need to have the depth of thinking, it is possible to see through the nature of the problem. Look beyond the problem is caused by the appearance of things to the essence, to the deep-level mining. For example, see the section of Java code, to know how it performs in the JVM (Java Virtual Machine, Java Virtual Machine); a cross-network calls, know how to reach the target position data through a variety of media (such as LAN port). Look beyond the problem, enabling architects to quickly discovered the truth underlying end to end closed-loop way to think about the problem, the system can identify the shortcomings and resolve it.

Another very important point, to landing architecture is good architecture, so architects also need to have good communication skills (emotional), to ensure that the parties reach a consensus on the framework, willing to take concerted action; and good trade-offs capacity (reason), under the existing framework to ensure that resource constraints is the most reasonable, eventually make ideal into reality.

Guess you like

Origin www.cnblogs.com/awzh2020/p/12464851.html