In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what are the principles that architecture design needs to follow". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought. Let's study and learn what are the principles of architecture design.
When designing the architecture, I think we need to follow the following principles:
Principle of consistency
Principle of simplicity
Evolution principle
Principle of consistency
Consistency is the foundation of the quality principle of software architecture. the software architecture that follows the principle of consistency can effectively ensure the clarity and directness of the whole architecture solution and reduce the complexity of the solution. Especially for a large-scale system, it often needs to be developed jointly by multiple teams. if the principle of consistency is not followed, it will lead to the lack of integrity and standardization of the construction of the whole platform, each subsystem goes its own way, and business functions are developed repeatedly. Technology implementation is varied, service integration is complex and inefficient, and information redundancy creates knowledge barriers.
The principle of consistency is embodied as follows:
(1) consistency of architectural style
For the same business complexity and technical complexity, it is necessary to form a unified architecture style. For example, the exposed business capability adopts the micro-service architecture style, which ensures the high cohesion and low coupling of each service, which ensures the scalability of the whole system; the data acquisition, governance and analysis business adopts the big data architecture style based on Lambda architecture pattern, and establishes batch processing layer and speed processing layer for data processing to meet the data needs of different business scenarios. The asynchronous message cooperation between services adopts the event-driven architecture style, which ensures the high efficiency and real-time message transmission between services, and improves the response ability of the whole system.
(2) consistency of technology selection.
For the same or similar problems, the same scheme and technology should be adopted, so that after mastering one of the solutions, developers can deduce the same solution for similar problems and reduce the complexity of the solution. avoid repeated development and reduce the cost of code maintenance. Take the micro-service architecture as an example, technology selection mainly includes micro-service components, log processing, rights management, distributed transactions, database access, message communication mechanism, caching technology, security policy, development language, framework version, monitoring and operation and maintenance. At the same time, the development team is required to follow consistent coding specifications.
Principle of simplicity
The purpose of software architecture is to control the complexity of the software system. The analysis of the complexity of the software system mainly comes from the scale, structure and change.
The complexity caused by scale can be solved by the idea of "divide and conquer", that is, the whole system is divided into several small and simple modules (components or services) according to the business dimension. the size of each service can be controlled by the team or team members.
The complexity caused by the structure depends on the number of modules (components or services) involved in collaboration, and the greater the number, the more complex the relationship between modules, because the dependency generated by collaboration can easily make the whole system chaotic and disorder. increases the cost of development and maintenance. In order to reduce complexity, it is necessary to clearly define the boundaries of modules and assign responsibilities reasonably to reduce unnecessary dependencies; at the same time, define a consistent and stable cooperation interface to make the cooperation between modules orderly, clearly reflect the call chain between each other, and make clear the direction of message data transmission.
Changes in requirements always lead to adjustments to the solution, which eventually makes the constantly changing solution more and more complex. How to deal with the change of demand effectively? On the one hand, the team needs to identify hot features that may change in advance, on the other hand, it also needs to pay attention to avoid over-design for the future. If the hot function of the change can be identified, the implementation scheme can be scalable as much as possible and the impact of the change can be minimized by encapsulating or abstract design principles. However, future changes are always unpredictable, if you are not sure whether there will be changes in the future, then do not introduce too much indirect and abstract, resulting in over-design, increasing the complexity of the solution.
The architecture that follows the principle of simplicity is as follows:
The bounded context pattern of domain-driven design is introduced to help reasonably identify micro-services, clarify the cooperation patterns between micro-services, determine the mapping relationship between business requirements and micro-services, and reduce unnecessary micro-service collaboration.
The front-end separation avoids the complexity superposition caused by the mixing of the front-end user experience complexity and the back-end business complexity, and also ensures that the front-end and back-end development teams define the front-end and back-end collaborative interfaces for parallel development.
Maintain the loose coupling of the interfaces between modules, and architecturally consider the separation of data analysis scenarios and business processing scenarios, so as to define the boundaries of the data platform, drive the interface for data exchange, and determine the mode of cooperation between the data platform and business services.
Identify the business capability of reuse: stand at the height of the product and analyze the business capability from a comprehensive perspective, encapsulate the business capability that meets a single responsibility into highly cohesive services or components, complete the reuse of functions, and reduce the code scale of the system. ensures the simplicity of the system.
Evolution principle
Architecture design is not achieved overnight, because the requirements will continue to change, the architecture design also needs to adjust to the changing requirements. Because the design and decision made by the architecture are often the most important part of a software system, and the adjustment to the architecture is costly and difficult, the evolution ability of the solution should be considered in the architecture design, that is, the continuous evolution of the architecture scheme can be realized with the minimum modification cost as the requirements change.
An architecture that follows the principles of evolution should meet:
(1) the ability to respond to change
One manifestation of the ability to evolve is the ability to respond to change, and a design principle is to minimize the impact of change. This principle determines that the architecture scheme needs to be divided into modules according to the direction of change, so as to adapt to the change. At the same time, it ensures the orthogonal relationship between business complexity and technology complexity, so as to prevent the change of business from affecting the change of technology implementation, and vice versa. We can follow the design idea of enterprise architecture and divide the whole system architecture into business architecture, application architecture, data architecture and technical architecture according to different perspectives. Among them, in order to reduce the impact of change, make the application architecture and data architecture of the system aim at the business architecture, that is, divide the responsibilities of the modules (components or services) of the system according to business capabilities, while ensuring that the domain model in each application module corresponds to the data model; for the technical architecture, the business and technology are separated by the hierarchical architecture pattern to ensure the loose coupling of the two.
(2) responsibility distribution and reasonable abstraction.
The quality of identifying and designing micro-services has a direct impact on the evolution ability of the system. the whole system needs to analyze the domain and assign the responsibility of functions from the perspective of business capabilities to ensure that each micro-service is cohesive. At the same time, through the effective identification of changing hot spots, the use of abstraction to reduce the coupling between each other, to ensure that the concrete implementation of the scalability and replaceability.
(3) the application of architecture model.
For the business system, we can ensure the loose coupling of the whole business system as much as possible and improve the evolution ability of the system architecture by adopting micro-service architecture pattern, event-driven architecture pattern and hierarchical architecture pattern. For the data platform, the pipeline-filter mode based on flow processing can be adopted to meet the needs of the whole data processing process by splitting the data processing function into filters (processor) and then freely combining these filters in the pipeline. This mode ensures the reusability and expansibility of the function.
Thank you for your reading. the above is the content of "what are the principles to be followed in architecture design". After the study of this article, I believe you have a deeper understanding of the principles that architecture design needs to follow. the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 264
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.