1
头图

foreword

With the development of the times, network communication has become an indispensable part of people's daily life. In the context of the 5G era, traditional network communication can no longer meet the needs of industrial-side and enterprise-strength application communication. Due to the requirements of security and stability, proprietary network communication has gradually become an important force in the communication market. As a communication operator, we should show our own communication advantages in the field of private network communication.

In addition to the development of communication technology, corresponding to the development needs of CT communication technology, as the front-end development of the IT side, it is also necessary to conform to the development of the times to build an architecture model that conforms to business and industrial models, and provide technical solution support for ICT integration. This article aims to illustrate the considerations and analysis of the front-end architecture design process from several different dimensions, such as systematization, structure, and robustness, through the business practice in the field of private network communication.

systematic

As the top-level design of the entire software engineering project, system design is the process of designing a new system that can meet the required goals to the greatest extent by using the ideas and methods of system science based on the results of system analysis. In the entire software architecture, as the forerunner and precursor of the overall project, systematicness needs to be able to run through the entire project period. This chapter will elaborate on the systematic thinking through four aspects: design concept, design method, design model, and design principle.

design concept

As the guideline of the entire system architecture, the design concept is the core concept and design philosophy of the entire system architecture. In the field of private network communication, combined with business needs and design methods in software engineering, the overall design concept is:

Simple, effective, deconstructed, controllable, extended

Simplicity: Implemented in the simplest way to maximize the complexity of the current granularity. It is convenient for development and verification, and provides a simple design pattern, which is conducive to the consensus of all personnel in the system, and provides the possibility for an effective and efficient organization.

Effective: split the problem with appropriate division granularity, do not over-design to avoid introducing unnecessary complexity into the system; also do not under-design to avoid redundancy. Improve software quality in Lean, solve problems in the most cost-effective way, and avoid any kind of redundancy.

Deconstruction: Determine the rights and responsibilities between granularity and granularity with a clear boundary, and internal integration under this granularity; outside this granularity, what needs to be exposed is shared with the outside world, and no isolation and sealing without exposure is required.

Controllable: input with reliable observation methods, output with the same result, observable; problems occur, clear positioning, can be traced; temporary changes, timely response, fault-tolerant.

Expansion: Provide progressive solutions, provide a complete ecosystem, be compatible and inclusive, customized according to needs, expandable and pluggable.

Design method

As a set of method theories arranged according to the development order of the architecture field, the design method is a comprehensive method summary after sorting out the complex business requirements. In the front-end development process, combined with the corresponding common different architecture classifications, the corresponding methodological summaries are made for each subset at different levels.

business architecture

The business architecture defines the corresponding capability or function matrix in line with the business output, and defines the business process. Corresponding to the front-end engineering, it needs to be implemented in business sequence, role assignment, authority authentication, etc.

data schema

A data architecture describes an organization's physical and logical data assets, as well as the structure of data resources. In front-end engineering, it corresponds to the design of the initial data structure. From a methodology, you can refer to different data sets for database schema design and access.

Application Architecture

Application Architecture provides a blueprint of individual application deployments, their interactions, their connections, the organization's core business processes, etc. For the front-end field, it is the aggregation and unification and isolated presentation of different applications, including but not limited to cross-end presentation and upstream and downstream logical concatenation.

Technology Architecture

The technical architecture describes the logical software and hardware capabilities needed to support the deployment of business, data and application services; this includes IT infrastructure, middleware, networking, etc. For the front-end, it includes various framework systems and corresponding ecological extensions, and selects technical solutions for scenarios that are more in line with the business.

design model

Software design uses different perspectives to design abstract software systems, and analyzes requirements to generate conceptual models. Common design models include: Object-Oriented Model (OOP), Domain-Oriented Model (DDD), Hexagonal Architecture, Onion Architecture, etc. The most important process of software design is abstraction, modeling the business and domain, extracting common and meta-information through abstraction, and constructing models of its own business and system through different combination modes. Extracting the design model is a highly condensed and extracted process that requires consideration of many factors. The abstract design model needs to do both top-level design and bottom-level design. The vision should be from top to bottom, and the disassembly should be from bottom to top.

Design Principles

In order to meet the characteristics of software development in the software design process, generally speaking, the following principles need to be met:

Single Responsibility Principle

The principle of single responsibility means that each granularity only focuses on one thing, which can reduce the complexity of single granularity, simplify logic, simplify responsibilities, and improve readability and system maintainability. During modifications and changes, the functional impact on other granularities can be reduced.

open closed principle

The principle of open and closed refers to opening for extension and closing for modification, which means that when requirements change, the modification of code changes should be mainly based on extensions, rather than modifying the previous code, which requires that in the process of design granularity Extensions are reserved for changes. Software requirements are always changing, so different system extensions can be built based on different design models without modifying the original system.

Liskov Substitution Principle

The Liskov substitution principle means that the concrete granularity can replace the abstract granularity, that is, the meta-information of the abstract granularity is completely abstracted concrete content, which is also one of the important verification methods of the open-closed principle. Satisfying the Liskov substitution principle indicates its openness and closure. It can be guaranteed that in different design models, different methods can be used to realize the link relationship between abstract granularity and concrete granularity.

Interface Segregation Principle

The principle of interface isolation means that the granularity should provide as detailed an interface as possible to the outside world, instead of providing a macro interface. The behaviors exposed to the outside world should be less and more specific. Refine the interface. By decentrally defining multiple interfaces, the proliferation of external changes can be prevented, the flexibility and maintainability of the system can be improved, and the boundaries can be clarified and established in the process of isolation from the outside world.

Dependency Inversion Principle

The Dependency Inversion Principle means that implementations should try to rely on abstractions rather than concrete implementations. The concrete depends on the abstraction, and the upper layer depends on the lower layer, which can reduce the coupling between granularities, improve the stability of the system, reduce the risks caused by parallel development, and improve the readability and maintainability of the code.

Demeter principle

Demeter's principle is also known as the principle of least knowledge, a software architecture entity should interact with other entities as little as possible. The closer the relationship between granularity and granularity is, the greater the coupling degree will be. Only by reducing the coupling between granularity and granularity as much as possible can it conform to the mode of software design. One granularity references or uses as few as possible in another granularity, so as to avoid related reactions between each other when changes occur. If related related operations must be carried out, the third party can be used to communicate with each other. Follow-up Changes only need to perform related operations on the third party, which is convenient for maintenance.

Combination/aggregation reuse principle

The principle of combination/aggregation reuse means that as much as possible should be reused instead of duplication. Through the granular construction of a single responsibility, as many combinations of related granularities as possible can be reused in other businesses, so that changes occur. , you only need to modify the corresponding granular content internally, and isolate the interface externally without affecting the use of the outside world.

structural

As an organic whole, the software system is composed of several different parts, and the structure is mainly measured from the perspective of the software organization structure, which contains or associates some information at different levels. From the earliest monolithic architecture, to the service-oriented SOA architecture, to the later microservice architecture, the evolution of different software architectures all reflect the importance of structure. For front-end engineering, common layered design is an effective way to implement software system structuring. This chapter will explain the structure of the architecture design in private network projects from three levels: gateway layer, application layer, and base layer. feature.

Gateway layer

In the traditional software development process, different business types expose different methods to the outside world. In network communication, we often use the gateway as the communication transmission connection between the internal network and the external network. In the process of software development, we can also draw on this idea to design and process our software system accordingly.

For the front-end in the private network field, the convergence and aggregation of various applications has become an important level of external exposure. The emergence of the gateway layer breaks the shackles of the framework and business stack: for internal applications, a service registration mechanism can be provided for the aggregation and collection of various applications; for external users, a unified service address can be provided to isolate users from internal The sense of separation brought about by changes in application.

application layer

As the different presentation forms of various services, the application layer is a sub-form that actually falls into various service forms. to the outside. The association and processing between various applications can be distributed and pulled up through the gateway layer; for internal purposes, the corresponding framework form can be selected to better process the required business, thus achieving high cohesion, Low-coupling software system association and isolation.

For the private network business form, it is necessary to provide professional business processing services, that is, generalized middle-end products and services; at the same time, it is also necessary to provide corresponding visual products and services to better display business data information, so as to transform the business on the CT side. The content is displayed in an IT format. The application layer can be expanded into different forms based on different business requirements, and new business forms such as cross-end and interaction can also be injected in the form of plug-ins, so as to be open to expansion and jointly build an ecosystem.

base layer

The basic layer provides common basic technical services for all businesses, avoiding individual business applications fighting against each other and forming their own independent technology stacks; at the same time, it also provides technical support for more business forms for the accumulation of business technology, so as to achieve technical capabilities Abstract general solution.

For the private network business form, its basic layer mainly provides basic service support for the entire production and research link, which facilitates the full-link channel connection of products, design, front-end, back-end, testing, and operation and maintenance. One-stop Solve the overall front-end upstream and downstream communication barriers, and create an efficient and simple integrated solution for production and research. On the product side, it provides support for wiki documentation; on the design side, it provides support for drawing beds, design materials, and design component libraries; on the front-end side, it provides development template tools such as scaffolding and monitoring; on the back-end side, it provides Technical settings such as static forwarding, BFF conversion, and interface joint debugging configuration are provided; on the test side, a general test suite is provided to facilitate the design and verification of test cases; on the operation and maintenance side, efficient CICD pipeline processing is provided, and a story board is provided and other functional solutions.

robustness

Robustness means that the software system maintains normal characteristics under the perturbation of certain parameters. According to different system-level requirements, the software architecture system is usually required to consider different robustness requirements in the design process. This chapter will explain the robustness of the system through high availability, high performance, high security, and high expansion.

High availability

The main purpose of high availability is to ensure the continuity of the business, that is, in the eyes of users, the business will always provide services to the outside world. To ensure the high availability of the architecture, it is necessary to ensure that all the granularities in the architecture and its exposed services can be as highly available as possible. For the front-end, it is usually necessary to ensure high availability during the service pull-up process, so methods such as redundancy and automatic failover can be used to deal with it.

For private network services, cloud-related basic operations are provided at the basic layer, and some high-availability and multiple copies of cloud-based services are used to achieve service availability. Strategy differentiation, so as to better provide technical theoretical support for product requirements such as business and user data collection, and close the entire link.

high performance

High performance refers to the highest utilization of resources, which can maximize the advantages of software and hardware. To ensure the high performance of the architecture, it is usually necessary to use different performance bottlenecks in different business forms for corresponding optimization and transformation. For the front end, because it is closer to the user side, its high performance usually includes several aspects such as network, rendering, and user experience.

In the private network service, due to the special transmission characteristics of the network layer, the optimization of the network is usually based on the optimization of the cloud-native network side, while the pressure on the rendering side can be selected based on different business forms, such as client-side rendering. (CSR), server-side rendering (SSR), native rendering (NSR), edge rendering (ESR) and other different rendering modes or hybrid rendering modes.

High security

High security refers to ensuring effective protection against system attacks and timely removal of potential dangers. To ensure the high security of the architecture, in addition to dealing with common attack methods, it is also necessary to monitor and control the system itself. For the front-end, since it is closer to the user, the user's operation is most likely to attack the security of its own system. Therefore, it is very important to do a good job of front-end security protection such as XSS and CSRF. At the same time, it is necessary to evaluate and monitor risks. .

In the private network business, the front-end monitoring of applications at different application layers is achieved at the basic layer, data collection and processing for performance and errors, etc., high-level protection for key and password settings, and network communication. Use encrypted transmission and other means to protect, and at the same time achieve different levels of interception and authentication for intermediate access.

High expansion

High expansion refers to ensuring the rapid response of the system in order to support the growing demand without changing the overall core architecture of the system. To ensure the high scalability of the architecture, it is usually necessary to fully consider the kernel shape and define the boundaries between changeable and unchangeable. For the front-end, it is usually necessary to consider the changes in different product requirements, and extract the part that can be extracted as much as possible. For different programming paradigms, use programming solutions that conform to business methods. For example, in the process of using object-oriented programming, try to Use design patterns etc. for business requirements and proper coding etc.

For private network services, high expansion uses the service discovery and registration mechanism of the front-end gateway to pull up the corresponding micro-applications, so as to realize the micro-service of the front-end. Page form, iframe-like form, web component-like form, container-like form and other micro-front-end solutions to achieve overall high expansion and compatible processing.

Summarize

Compared with the development of the back-end, the development of the front-end has experienced the following changes: in the ancient times, the browser was born, and with the first browser war, the front-end focused on the construction of static pages; in the Stone Age , the emergence of ajax technology, the front-end work involves part of the data interaction work, and also the second-generation browser war; in the agricultural era, in the face of the compatibility requirements of the respective APIs provided by different browsers, the front-end first A library-based development model appeared once, and a number of class libraries such as jQuery, YUI, ExtJS, etc. emerged; then, with the advent of the industrial age, the front-end also undertaken more data interaction work, from the previous The server-side rendering of pages has shifted to the era of browser client-side rendering pages, and the concept of front-end frameworks has also emerged in this era; in the more recent information age, with the emergence of different terminals, various cross-terminals have appeared in the front-end. The requirement of experience consistency has brought solutions of different rendering modes; in the current cloud-edge-end era, based on different business forms and business directions, the front-end presents a more diverse and complex form, with the help of other software fields development, the front-end form is more diverse and generalized.

For the emerging business forms and demands, the front-end has gradually evolved from a simple page cut to the governance of the overall software architecture. In the field of software engineering, all business forms can be completed by splicing different abstract composite architectures, but a reasonable and elegant architecture should not only consider global scheduling and symbiosis, but also local optimization and trade-offs. The way is clear direction, the law is based on the foundation, the art is based on the strategy, the power is based on the person, and the instrument is based on the achievement.

refer to


维李设论
1.1k 声望4k 粉丝

专注大前端领域发展