[Architecture] System architecture Orthogonal decomposition method

Source: Internet
Author: User
Tags in domain

[Architecture] System Architecture orthogonal decomposition method preface

As the enterprise grows, the software that supports the enterprise business will become more and more complex. When the system is complex to a certain extent, developers will find a lot of system architecture design details, it is difficult to organize, organized with a large blueprint to do analysis design. Previously saw an article on Infoq: " billion users under the Sina Weibo platform architecture-Guardian Army ", in this article, the use of orthogonal decomposition method to analyze the design of Sina Weibo platform system architecture.

By means of the orthogonal decomposition method, table-style columns and decomposition can allow developers to understand the focus of each quadrant in order to understand the framework technology used to organize the entire system architecture. This article describes how to use the orthogonal decomposition method to analyze the design of the system architecture, mainly to leave a record for themselves, but also hope to help the need for developers.

Horizontal layering

Using the orthogonal decomposition method to analyze the design system architecture, we must first disassemble the horizontal stratification. The horizontal layering of the disassembly method, the developer can according to the n-tier cutting way to dismantle the horizontal stratification. In the following example in this article, you use the classic three-tier architecture to dismantle horizontal hierarchies:

    • Presentation Layer (Presentation): Represents the interface that the layer uses to classify and organize the functions provided by the system. The function interface defined here, there are two concepts, one is to use the function interface, one is to the computer to see the function interface. For example, a reconciliation system may provide HTML pages for users to use, or may provide restful APIs to other system calls. The analysis, design, and implementation of these functional interfaces are categorized into the quadrant range of the presentation layer.

    • Domain layer: Domain layer is used to classify and organize the domain logic provided by the system. Software is used to deal with specific areas of the problem, each software through the program code to solve the problem, encapsulated into a function library or a set of objects to provide system use, these are called domain logic. The analysis, design, and implementation of these domain logic will be categorized into the quadrant scope of the domain layer.

    • Access Layer (accesses): The access layer is used to classify and organize the access media used by the system. In the process of system operation, some parameters, records, data ... And so on, persist to the database for follow-up, or you need to get these related messages from other systems for processing. The analysis, design, and implementation of these access vectors are categorized into the quadrant range of the access layer.

Vertical layering

Traditionally, after the system has disassembled the N-tier architecture according to its characteristics and scope, it is possible to begin the analysis and design of the functional modules within each tier. However, the orthogonal decomposition method is used to analyze the design system architecture, and after the horizontal stratification is disassembled, the vertical stratification is also disassembled. Vertical layering is a way for developers to disassemble vertical hierarchies according to different requirements. In the follow-up example of this article, the vertical layering is disassembled using several requirements facing the " Sina Weibo platform architecture-Guardian army" under the "billions of users ":

    • Technical architecture: Technology architecture for classification and organization, platform-oriented functional modules. The system does not involve domain logic, platform-level reuse of functional modules, will be categorized into the technical framework of this vertical layering. For example: A custom WEBAPI framework that includes token login, data encryption, route assignment, and so on, which are not involved in domain logic, and can be used as a platform to repeatedly provide other functional modules. These functional modules, frameworks, and strategies are categorized into the quadrant of the technical architecture.

    • Application Architecture: Application architecture is used to classify and organize the functional modules for the domain requirements. The functional modules that encapsulate domain logic and interact with each other in the system are categorized into the vertical layering of application architectures. For example: A mall system will contain, order tracking, customer data, business evaluation and other functional modules, these functional modules encapsulate the system's domain logic, and interact with each other. These functional modules, frameworks, and strategies are categorized into the quadrant range of the application architecture.

    • Monitoring architecture: A functional module for the classification and organization of the monitoring architecture and for the requirements of the operational dimension. The system does not involve the domain logic, package monitoring logic function module, will be classified into the monitoring architecture of this vertical layer. For example, an RPC monitoring module that includes RPC response time, RPC load per second, and so on, which is not involved in domain logic, and encapsulates the monitoring logic. These functional modules, frameworks, and strategies are categorized into the quadrant range of the monitoring architecture.

01. Technical Architecture X Presentation layer

In the quadrant "Technology Architecture x Presentation Layer", developers can focus on the following: No domain logic, platform-level reuse, and presentation layer. To think about this point of concern, you can come up with whether the choice of ASP. NET MVC or spring MVC to develop the presentation layer of the system, will inevitably according to the needs and characteristics of the system or enterprise, to refine their presentation framework, to improve the system's output and production value. Similar to these functional modules, frameworks, and strategies, will be categorized into the quadrant range of the "Technical Architecture x Presentation layer". In the follow-up instructions in this section, we introduce some common functional modules, frameworks and strategies:

    • Website framework: Website framework encapsulates route dispatch, PASSWOD validation, cookie validation, OAuth validation, model serialization \ Crossdress serialization, HTML rendering ... and other functions. This website framework, which supports the function modules in the "Application Architecture x Presentation layer", develops HTML page for use by external users. And the framework provides an injection interface for the "Monitoring Architecture x Presentation Layer", which monitors website response times, online numbers, popular pages, and more.

    • WEBAPI Framework: WEBAPI framework encapsulates route assignment, PASSWOD validation, token validation, model serialization \ Crossdress serialization ... and other functions. This WEBAPI framework supports the development of the rest API for external systems using the functional modules in the application Architecture x presentation layer. And the framework provides an injection interface that allows the "Monitoring Architecture x Presentation layer" to monitor WEBAPI response time, load per second, error logging, and more.

02. Technical Architecture x Domain layer

In the quadrant "Technology architecture x Domain Layer", developers can focus on: No domain logic, platform-level reuse, and domain level. To think of the above concerns, you can come up with each functional module in the domain layer of interaction between each other, need to establish a platform-level distributed framework to provide: service registration and discovery, remote invocation, timing execution and so on, to improve the system's output and production value. Similar to these functional modules, frameworks, and strategies, will be categorized into the quadrant scope of the "Technical architecture x Domain Layer". In the follow-up instructions in this section, we introduce some common functional modules, frameworks and strategies:

    • Service Coordination framework: Service Coordination framework encapsulates service registration, service query, service heartbeat ... and other functions. This service coordination framework, supporting the "Application Architecture x domain layer, presentation layer" In the function module, to obtain the dependency function module online information and survival status. And the framework provides an injection interface that allows the "Monitoring architecture x Domain Layer" to monitor the number of services, survival status, etc. of the function module.

    • Remote Call framework: The remote call framework encapsulates the provisioning, consumer, synchronous, asynchronous, and error-handling ... and other functions. This remote call framework supports the function modules in the "Application Architecture x Domain Layer" and establishes the supply side to provide remote invocation services. Support "Application architecture x domain layer, presentation layer" In the function module, set up a consumer to use remote Call service. And the framework provides an injection interface that allows the "Monitoring architecture x Domain Layer" to monitor the response time, load per second, error logging, and so on for the function module.

    • Message Queuing framework: Message Queuing framework encapsulates the creation of queues, sending messages, getting messages, distributing policies ... and other functions. This message queue framework, which supports the function modules in the application Architecture x domain layer, establishes message queues to process messages sequentially. Support "Application architecture x domain layer, presentation layer" In the function module, set up the sending side to send messages to the message queue. And the framework provides an injection interface that allows the "Monitoring architecture x Domain Layer" to monitor message queue processing time, load per second, number of queue stacks, and more.

    • Scheduling Job Framework: Scheduling job framework encapsulates the establishment of jobs, scheduled execution of jobs, periodic execution of jobs, error handling ... and other functions. This scheduling framework, supporting the "Application Architecture x domain layer, presentation layer," The function module, set up a schedule to execute the job to invoke the service or send a message. And the framework provides an injection interface that allows the "Monitoring architecture x Domain Layer" to monitor processing time, execution history, error logging, and so on for scheduled jobs.

03. Technical Architecture x Access Layer

In the quadrant "technology Architecture x Access Layer", developers can focus on: No domain logic, platform-level reuse, and access layer. With the above points of concern to think, can send out in the access layer in order to due to a large number of users, need to provide platform-level large concurrency strategy and framework, to increase access performance, avoid access performance bottlenecks. Similar to these functional modules, frameworks, and strategies, will be categorized into the quadrant range of the "Technical Architecture x Access Layer". In the follow-up instructions in this section, we introduce some common functional modules, frameworks and strategies:

    • Data cache Framework: Fast-access framework encapsulates data cache policy, quick-take, quick-fetch, quick-fetch, clear ... and other functions. This data cache framework guides the storage media in the application Architecture x access layer and how to design the data cache. Supports the function modules in the "Application Architecture x Domain Layer" to establish and use the L1\L2 cache data through the framework function. And the framework provides an injection interface to allow the "Monitoring Architecture x Access Layer" to monitor the data cache frame's cache hit rate, cache load, and so on.

    • Read/write Separation framework: Read/write separation framework encapsulates the read-write separation policy, read/write separation, read/write separation query ... and other functions. This read-write separation framework guides the storage media in the application Architecture x access layer and how to design the sub-database. Support the functional modules in the "Application Architecture x Domain Layer" to delete the segmented storage media through the framework function. And the framework provides an injection interface that allows the "Monitoring architecture x Access Layer" to monitor the query performance, data load, and so on of the read-write separation framework.

    • Sub-database Sub-table framework: Sub-database sub-table framework encapsulates the sub-database sub-table strategy policy, sub-database sub-table new, sub-database sub-table query ... and other functions. This sub-database sub-table framework, guide the "Application Architecture x Access Layer" in the storage medium, how to carry out the design of the sub-table sub-database. Support the functional modules in the "Application Architecture x Domain Layer" to delete the segmented storage media through the framework function. The framework provides an injection interface for "Monitoring Architecture x Access Layer", which can monitor the query performance, data load and so on of the sub-table framework.

04. Application Architecture x Presentation layer

In the Quadrant "Application Architecture x Presentation Layer", developers can focus on the following: encapsulation domain logic, application presentation layer. The domain logic encapsulated in the system needs to be encapsulated in this quadrant to be open to external systems or users. Developers can classify the functional modules encapsulated by the organization presentation layer according to the domain logic's orientation. These feature modules use the framework provided by the technical Architecture x presentation layer to create a Rest API or Web page for external systems and users. and use the functional modules provided by the technical architecture x domain layer to invoke the domain logic encapsulated in the application Architecture x logic layer.

05. Application Architecture x Domain layer

In the Quadrant "Application Architecture x Domain Layer", developers can focus on the following: Packaging domain logic, application domain layer. All domain logic provided in the system will be encapsulated as a function module in this quadrant. Developers can classify the functional modules encapsulated by the organizational domain layer according to the domain logic's orientation. These feature modules use the framework provided by the technical architecture x domain layer to provide and use domain logic. And through the "Technology Architecture x Access Layer" provided by the function module, to access the "Application Architecture x Access Layer" in the persistence of data.

06. Application Architecture x Access Layer

In the Quadrant "Application Architecture x Access Layer", developers can focus on the following: encapsulation domain logic, application access layer. The persistent data generated by the logical execution of all domains in the system is stored in these quadrants. Developers can choose the type of storage medium according to the requirements of the system. These storage media, through the "Technology Architecture x Access Layer" provided by the strategic Approach to design planning. and through the function modules provided by the technology architecture x Access layer, the application architecture x domain layer is able to access persistent data located in the Access media.

07. Monitoring Architecture x Presentation layer, logical layer, access layer

"Monitoring Architecture x presentation layer, logic layer, Access layer" in the quadrant of the function module, according to the "Technical architecture x presentation layer, logic layer, Access layer" corresponding level of open injection interface, to monitor the corresponding function module parameters. For example: Monitor the response time of the website framework in the technical architecture x presentation layer, online numbers, popular pages, and more. The design of the monitoring platform, from the level of technical architecture, to minimize the intrusion of the application architecture, can effectively reduce the complexity of the application architecture, thereby increasing the value of the system and production capacity, and will not reduce the related ability of system monitoring.

Conclusion

The orthogonal decomposition method cuts the system architecture into horizontal n-tier, is oriented to the vertical demand, and then interacts with the different points of interest in each quadrant. And in accordance with the project needs, but also to do more complex conditions to expand. For example: Horizontal layering can be added to the tier that provides mobile, HTML5 spa, and vertical partitioning can be added to test-oriented, deployment-oriented requirements.

By means of a cutting method such as orthogonal decomposition, it is possible to reduce the point of concern for each quadrant of the developer, and the tabular analysis design also reduces the likelihood of developers missing a particular point of concern. Whether it's developing a new system or looking at an old system, developers are highly recommended to try it out.

Reference data
    • Sina Weibo platform architecture for billions of users-Guardian Army

    • Three-layer architecture design-sleeping areas

[Architecture] System architecture Orthogonal decomposition method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.