Architecture Design

 Table of contents

1. Essence

2. The difference between software development and architecture design

3. Three principles of architecture design

4. Architecture Design Methodology

write at the end

1. Essence

Before understanding the essence of architecture, first understand the definition of architecture. Baidu Encyclopedia's definition of architecture: architecture, also known as software architecture, is an abstract description of the overall structure and components of software, which is used to guide the design of various aspects of large-scale software systems;

From the definition, we extract several keywords: component, structure, relationship;

  • Components: Can also be called software elements or architectural elements. It can be subsystems, modules, and application services, depending on the granularity.
  • Structure: It is the output after the architecture. Different software systems have different structures, which are designed to solve different scenarios.
  • Relationships: Implement connections between architectural components. The connection relationship can be an internal JVM call, a distributed call between components, or a cross-application call, or an integrated call with an external system interface.

        Architecture can be understood as connecting software components according to a certain structure; how do software components come to be found, what structure is used to connect, and how to connect? These problems are problems caused by software complexity.

        The essence of architecture design is to solve the problems caused by software complexity. There are many forms of software complexity, such as business complexity, performance complexity, usability complexity, scalability complexity, security complexity, etc.; It focuses on solving the complexity problem. Understanding what software complexity needs to be solved behind each architecture solution is the key factor for judging the purpose of an architecture design. This is also a system constraint that is often mentioned in architecture design;

        Business complexity reflects how to disassemble the business, find suitable software elements and components, and connect according to the structure; performance complexity reflects how to find software elements, perform appropriate connections to form a certain structure, and meet high performance requirements. For example, a large-scale ERP system is a system with high business complexity. How do you split it into independent and complete components with clear business boundaries? This is something that needs to be considered in architecture design. Another example is to build a flash kill system. The system complexity requirement is the performance complexity. How can we handle the peak of flash kills? This is a problem that needs to be solved in terms of performance complexity.

2. The difference between software development and architecture design

        Software development is more oriented towards deterministic logic issues. It is implemented based on its own understanding of requirements. The implementation method is relatively fixed. Process development completes the required functions and achieves the ultimate goal. For example, the ability to receive orders is divided into several steps: parameter verification, Commodity query, inventory preemption, order generation, inventory deduction, order status modification, and status return; the business logic is relatively fixed. If coding specifications and framework constraints are added, in addition to the data model and coding design, other aspects are more involved. few.

        Architecture design is more oriented towards uncertainty. How to split the system into components, how to identify whether it is a component, and how to connect between components? These are architectural solutions with many possibilities. To solve a software complexity problem, there are solution A, solution B, and even solution C. Which one should be used and what is the reason are all issues that need to be considered in architectural design; How to make decisions between different options, how to judge the reasonableness of the option you choose, of course, decision-making ability is not determined by brains, it actually needs a series of principles to guide, through these guiding principles plus actual experience to make decisions Excellent solution;

3. Three principles of architecture design

        When it comes to architecture design, I have to talk about three basic principles. As a reference in the architecture design process, it is better to help with analysis, decision-making, and support.

        The first thing to mention is the principle of suitability. Everything that is not designed according to the actual scene is a hooligan. For example, if you want to buy a car, if you buy it expensive, you think it is not cost-effective, and if you buy it cheap, you feel uncomfortable to drive. You will eventually choose one that suits the current situation. A car that is more comfortable within the economic capacity, this is the principle of suitability. Aim at the current business needs and non-functional needs, match the stage of business development, and rationally use resources to maximize value (buying a car needs to match the current economic state); it needs to be combined with actual scenarios and a suitable system architecture (I buy a car It’s just for commuting, I can’t say that I think sports cars are stylish, so I’ll just buy a sports car, which doesn’t match the actual business scenario); it also needs to match the current business scale and the development plan for the next one to two years (although I pay a lump sum I can’t afford it, but I have a stable income. I can consider taking out a loan with a 2-year period. In this way, I can buy the ideal car model without worrying about the pressure); the introduction of new technologies is bound to solve the problem in a certain scenario, but It cannot solve all problems. Any architecture must be viewed comprehensively and combined with appropriate principles for comprehensive selection.

        The second is the principle of simplicity, the avenue is the simplest, everything is simplified, and the simplest solution is used to solve the problem. KISS (Keep Simple and Stupid) is the highest state of user experience, and it is also applicable to architecture design; simplicity is the goal of software design. Simple code takes up less time, has fewer bugs, and is easy to modify, maintain, expand and refactor; don't think that simple design has no technical content, and it requires excellent architectural design capabilities to deal with complex problems with simple design; the reason why software systems are It is said to be complex, which is reflected in the complex structure and complex logic. A complex problem is composed of multiple simple problems. The difficulty is how to disassemble it; disassemble it into multiple problems and solve them one by one. A single execution unit, the code size of a single execution unit must be as small as possible. A complex logic system implements all logic functions internally, which will cause problems in almost every link. It needs to face changing requirements, everyone maintains the same set of code, and the entire development, testing, and online processes become extremely heavy;

        Finally, there is the principle of evolution. Only change is eternal. An excellent architecture must evolve through continuous business development; the design architecture must meet the needs of the business at the time, have scalability and continuous development capabilities, and be able to adapt to subsequent architecture upgrades and Adjustment; It is necessary to continuously iterate in the actual application process, retain the excellent design, repair the defective design, correct the wrong design, eliminate the useless design, gradually improve the architecture, and distinguish the changed part from the unchanged part;

4. Architecture Design Methodology

        When it comes to architecture design methodology, first introduce TOGAF (The Open Group Architecture Framework), which is formulated by The Open Group, an international standard authority organization. It is an industry-standard architecture framework. It is a set of methods and tools. It mainly includes three parts: TOGAF Capability Framework, TOGAF Architecture Development Methodology, TOGAF Enterprise Continuum and Tools.

The following mainly introduces the software development method (Architecture Development Method) ADM

The ADM software development methodology consists of a set of phases arranged in a ring according to the architectural development sequence of the architectural domain.

The ADM infrastructure diagram is shown below

Preparatory stage: Sort out business requirements and understand the real business goals behind the requirements;

Architectural vision: In the end, an effect needs to be achieved, and planning needs to be done in advance;

Business architecture, information system architecture, and technical architecture belong to the architecture domain design framework;

Technology and solutions: When encountering technical problems, one or even multiple sets of solutions are required. The responsibility of architecture design is to make trade-offs and decisions.

Migration planning and implementation governance: follow-up online operation and maintenance related matters, and give reasonable solutions;

        Architecture design methodology is to guide you how to do architecture design. It has architecture domain division. In software design, architecture domains include: business architecture, data architecture, product architecture, application architecture, and technical architecture. First, you need to combine business requirements with business scenarios. After sorting out and getting familiar with the business, the business structure is formed through induction and abstraction. According to the understanding of the business structure, R&D personnel need to further abstract and precipitate the business, draw the corresponding data structure and application structure, and finally the technology Personnel implement functions through technical architecture. The business architecture is the goal and the direction, the application architecture is the abstraction and the induction, and the technical architecture is the means and the reference of the system implementation.

The figure below shows the conceptual blueprint for the development of the ADM architecture

        First look at the business architecture. The business generally draws a business architecture diagram according to the four layers of scenario layer, product function layer, domain model layer, and dependency layer.

Scenario layer: describe business scenarios

Product function layer: divide product functions and modules;

Domain model layer: through the analysis of product functions, abstract the domain model;

Dependency layer: From the business level, consider which subsystems or components the underlying business depends on;

The following is an example of a system to illustrate - logistics independent account platform

System business goals

  • Realize a multi-tenant independent account platform, which can isolate data by tenant;
  • Support a variety of login methods, and have complete personal information registration, management and other functions;
  • Personalized configuration such as domain name, login, and registration can be performed according to tenants;

The following figure shows the business architecture diagram of the independent account platform

The second is the data structure: the data structure solves what data is needed; the second is how to store it; the third is how to design it.

The most commonly used view of the data model is the ER diagram, which mainly describes data entities, attributes and relationships.

  • Entity: domain object
  • Attribute: domain object attribute
  • Contact (RelationShip): The relationship between two domain objects (1:1, 1:n or m:n)

The following is the data structure of the independent account platform

Then there is the application architecture. The application architecture is divided into different functional modules, and then combined into subsystems according to the relationship between the functional modules. There are three questions about application architecture relationship: first: how to divide subsystems; second: what is the relationship between subsystems; third: consider the reuse of modules and the abstraction of functions; the application architecture requires a clear and hierarchical division of the application architecture Whether it is clear, whether the connection relationship between various application systems is reasonable, whether the degree of coupling between systems is low, and whether a consistent service interface is provided externally in a unified manner;

The following figure is the application architecture diagram of the independent account platform

 The last is the technical architecture, which focuses on issues such as how to use technical means to solve practical problems, how to choose a technical framework, how to choose a technical middleware, how to implement storage, and how to implement non-functional requirements. The output of the overall technical solution is the process of realizing the technical architecture, which will eventually form key technical implementation points and form a complete technical architecture.

The following figure shows the technical architecture of the independent account platform

 write at the end

        Architecture design is a long-term process that requires continuous polishing. The architecture of any system cannot be achieved overnight. It requires continuous optimization and iteration when the system faces technical and business problems. In addition to mastering the technical framework, technical components, and technical principles, architecture design In addition to knowledge, it is also necessary to systematically master the basic knowledge of architecture, guided by the principles of architecture design, master the methodology of architecture design, and achieve better architecture design through continuous optimization and iteration.

Guess you like

Origin blog.csdn.net/changlina_1989/article/details/125605264