Application Structure: Concept View-7 Processing (Enterprise Structure)

xiaoxiao2021-03-06  73

This page

Processing Service Introduction The advantages of service processing services Use the benefits of processing service guidelines processing services

When using multiple services to create a system, it is easy to interruption. For example, there may be a service to call another five services, and in these five services, some will call other services, so that the system will lose control soon. Since each service must identify the interfaces of its calling services, the large system will eventually contain a lot of dependencies. It will also create multiple entry points in the system, which will further make the system out of control.

Figure 1 shows how many services have become difficult to manage.

Figure 1. Lost service

In this scheme, the processing and business operation are tightly wound. Although a message-delivered message in all services provides an implicit process, it is difficult to change this processing in this case so that it meets your unit. It also makes it difficult to find out the problem in the system.

In the case of employee hire / dismissal, one example of this situation: To implement all necessary tasks, you need to communicate with a large number of services. Need to report to the human resource department, an employee, notify the information department to update user accounts and domain information, and notify the security department to update the employee to enter the building, and so on. Each task contains a series of steps during the implementation; for example, the human resource service needs to add new employees to the company's salary list, phone number book, notification list, and so on. To make all these systems know each other, you need to create many dependencies throughout the system, which will not be conducive to system maintenance.

Introduction to processing service

A reasonable solution is to separate the process factors of the service to form a dedicated business process. Business processing (ie, processing) controls the step-by-step operation of certain work, enters another state from one state. It will call a business operation at each step. These processes can be managed in business processing services or processing services. The process in this processing service will send a message to call the service operation included in the service, then continue to perform the next step, and in the next step, you will need to use different services.

For the previously mentioned employee information example, you can create a process responsible for communicating with individual departments. In this way, each department will have its own processing to control the steps required to complete internal business functions.

Figure 2 demonstrates how to use these processing services to concentrate these functions.

Figure 2. Using processing services

Back to top

Advantages of business processing services

There are many advantages to using business processing services, including:

• Better control of business processing. Using the processing service can provide a central service that controls the interaction of other services, so that the operation information and management information can be queried. This will further improve the management and maintenance of the system. For example, when you design ordered an application, you can add a function in your handle, so you can query the number of the current order or the total cost of these orders. It is also possible to use business processing to obtain the time occupied by the specific step in the process or the load of different parts of the interrogation system at any time. • Reduce system overhead processing changes. Most systems' handling definitions are dynamic; it will be changed according to business decisions within the organization. On the other hand, the change in core business functions will not be so fast and their changes are topical. Separating the two factors of the function more conducive to processing itself. For example, you can change the steps required for the next order, request address information to the Customer Relationship Management (CRM) system instead of each order manually entering an address information, but this does not change the actual order into the order system. If processing is defined for business logic at other locations, the call to the CRM service can be added more easily in the step. • Reduce the number of dependencies. These services must identify their respective service interfaces when many services interact directly. In this way, when combined more services, the number of dependencies will increase by index of the number of services. The central management point provided by the processing service is used, and the star topology can be used, and its total dependency is linearly reserved in the system. • Simplify external communication. Only an entry point is only exposed to the outside, which simplifies the connection of external services and easier to ensure that the system does not have a back door. • Simplify exception handling. In a distributed system, if there is no independent processing service, it is difficult to determine the task you need to perform when an exception occurs. If you use the processing service, you can have a central management area to control every step in the process, which means you can overview the overall situation, making it easier to find the steps required to solve the problem. Back to top

Use processing service guidelines

To avoid many agreements and decouple the service, the following practices are good choices:

• Avoid direct communication between business services. Make the business service communicate through the processing service. Thus, an exception handling center point and a central point of an extended system function will be formed; in the future, there will be an opportunity to add additional calls. If this means only a single operation can define a process, then this is. It is easy to optimize during implementation or deployment; it is difficult to design from head design. • Make your subscription event instead of your business service subscription event. Its reasoning is identical to the previous paragraphs. • Use a coarse particle size request between service and service (especially top-level processing services). If necessary, processing can split such request into a finer granularity request. Compared with the coarse particle size request change is small, therefore, there is thus a small amount of communication. • Create business services that provide stateless sessions. That is, there is no need to retain the service interface of the processed state, which will require maintaining the processing synchronization of both parties, so that this complex is not necessary. • Avoid public confidential / technical details. The internal information of the public service, regardless of this internal information, algorithm or database layout, will make future changes become more difficult. • Do not share atomic transactions between services. This has been previously stated; the ACID transaction requires an external locking data, and the time for such locking is uncertain. Even if another service is completely trusted, it cannot guarantee that both services are always close to each other and always maintain a reliable and fast connection. The shared transaction is a tight coupling form.

Note that if you do not provide any other values ​​due to processing only, it is best to optimize it instead of designing it. If you need to extend processing in the future, the undo optimization is easier than design processing. Since the message routing infrastructure can be used to perform optimization, there is no need to modify the client to accommodate this change.

Processing services manipulating their data acquired from other services; they handle reference data and each processing status. The processing service can use the service agent to manage this part of its status, as shown in Figure 3. Figure 3. Processing Service Using Service Agents

Back to top

The benefits of processing services

The following benefits can be brought about by using the processing services described here:

• Centralized and structured exception handling. Since the services involved in any task have a centralized process, the exception handling and any correction request can be controlled from one place. • Limited quantity dependencies. Since the service is not directly interacting, a service does not need to know the service interface of other services. • Processing is easy to manage. The centralization of the processing function makes it easier to manage such as task scheduling. • Adaptability of processing is improved. Because processing is independent of business logic, it is easier to implement updates to handle without interfering with the application core business function.

Back to top

Treatment

Using processing can control the process factors of the service and separate it from functional factors. This process can be implemented in the service, or it can be implemented as a dedicated independent service.

By this separation, a central point of a control service interaction can be obtained, so that the service processing can be better controlled. This means that managing this process will become easier and can be changed at any time according to the changes required by the system. This also means that there is only one entry point. The use of the processing service also provides a set point of the error handling within the system.

Go to the original English page

转载请注明原文地址:https://www.9cbs.com/read-92666.html

New Post(0)