Learning Sharing (Phase 3): What is the architecture you understand?

What is architecture?

When it comes to architecture, there is no clear scope of this concept, and there is no standard definition. Everyone's understanding may be different.

Architecture is defined in Baidu Encyclopedia as follows: architecture, also known as software architecture, is an abstract description of the overall structure and components of software, and is used to guide the design of all aspects of large-scale software systems.

We can understand that the main purpose of architecture design is to solve the problems caused by the complexity of software systems.

Mary Shaw and David Garlan of Carnegie Mellon University write in their article "An Introduction to Software Architecture":

“When systems are constructed from many components, the organization of the overall system-the software architecture-presents a new set of design problems.”

Translation: As the size of software systems increases, computation-related algorithms and data structures no longer constitute major design issues; when a system is composed of many A new set of design problems.

The core value of software architecture is to control the complexity of the system and separate and decouple core business logic and technical details.

The responsibility of the architect is to work hard to train their own thinking, use it to understand complex systems, understand and analyze requirements through reasonable decomposition and abstraction, create useful models, confirm, refine and expand models, and manage architectures; Decomposition forms an overall structure, enables correct technology selection, formulates technical specifications and effectively promotes implementation.

Architecture classification

In my cognitive system, the architecture is divided into business architecture, application architecture, and technical architecture. Of course, I have heard of data architecture, but the field of big data is beyond the scope of my knowledge, and I don't intend to do in-depth study.

Let's understand business architecture, application architecture and technical architecture.

In the initial stage of requirements, the description of business requirements is often vague. But in general, business needs are determined by company strategy. The system requirements generated by these strategies require business architects to carry out business implementation. The key point is to clarify the processing process behind these requirements and define the relationship between various business modules.

The application architecture and technical architecture exist to support the implementation of the business architecture. Their relationship is interlocking, the upper layer drives the lower layer, and the lower layer supports the upper layer.

Take the example of making a movie.

The business architecture defines the storyline and scene arrangement of the movie; the application architecture defines what roles and responsibilities are there, and how these roles interact in each scene; the technical architecture determines who will perform these roles, and the physical scene How is it arranged to ensure that the entire shooting can be completed smoothly.

Let’s take another example of e-commerce.

A product business may correspond to 3 applications, a front-end product display application, a background product management application, and a product basic service. The business architecture defines a specific process of placing an order; the application architecture defines which applications participate in the order and how they cooperate; the technical architecture must ensure that related applications can handle high concurrency, so as to ensure the smooth progress of the promotion.

business structure

When it comes to business, you have to mention the product manager. The responsibility of the product manager is: tell the user what the system looks like; tell the developer what function he wants to achieve. For example, we are now designing an e-commerce system. Users want to buy things on our system. A typical shopping process includes product browsing, adding to the shopping cart, placing an order, and paying.

The product manager must first materialize each step into a page prototype. In the prototype, the input or output of each step and the user's operation process are given intuitively, and finally these pages are connected to form a business process.

The business architect needs to design a shopping process module, which includes commodity query, adding shopping cart, ordering and payment interfaces to correspond to the four business steps in the process.

It is quite simple to say, but to realize this shopping process, it is actually a test of the skill of the business architect.

First of all, business architects must master the business and data models of different modules. This will involve the four businesses of commodity, shopping cart, order and payment at the same time, and the business architect must be very clear about the data model and business logic of these four parts at the same time.

Second, this module should be designed to be flexible enough. If the requirements of a business domain change, for example, an order needs to add a new state, then all modules involved in the order must know this change and make corresponding adjustments.

The business architecture diagram of the e-commerce system is drawn below for reference only:

application architecture

Application architecture is to clarify how the system is organized internally and how to call each other. The application architectures we are familiar with include: MVC architecture, layered architecture, and hexagonal architecture.

From the perspective of a single application, the application architecture defines the structure of the project package, such as the layered application architecture. I introduced the implementation of the layered application architecture in this article "Based on start.spring.io, I realized Java scaffolding customization" process, its hierarchical structure is shown in the following figure:

At the system level, the application architecture defines the calls and interactions between processes. The layered architecture diagram of the e-commerce system is drawn below for reference only:

Technology Architecture

Technical architecture is the implementation of technical solutions for the functions proposed in the business architecture. The key is to clarify which hardware, operating system, and middleware the system consists of, and how they cooperate with the applications we develop to deal with various abnormal situations and keep the system stable and available.

This also requires technical architects to have profound skills in computer technology. The first major challenge is: hardware.

From the perspective of technical architecture, there are generally two ways to improve the processing capability of hardware: Scale Up and Scale Out. Vertical scaling has physical bottlenecks or cost issues. Due to the physical limitations of the hardware, the performance of the machine has a ceiling. How to effectively manage a large number of machines with horizontal scaling, hardware is not 100% reliable, it will have its own problems.

The second biggest challenge: software.

The software here mainly refers to various middleware and system-level software. While the software fills the various pits of the hardware, it also digs new pits for the system.

For example, the multi-node Redis cluster solves the problem of single-node processing capacity, but it also brings new problems, such as multiple copies of Redis data, which solves the availability problem caused by a single server failure, but At the same time, it also brings the problem of data consistency.

The technical architecture diagram of the e-commerce system is drawn below for reference only:

the cover

related articles

Maybe you are also interested in the following article.

Supongo que te gusta

Origin blog.csdn.net/yang237061644/article/details/129537969
Recomendado
Clasificación