My opinion on the design of SMS

Source: Internet
Author: User


As an important module to maintain the stability and reliability of the system in the server, SMS (systemmanagementservice) plays a connecting role, and the following is the system monitoring service, which directly accepts various monitoring, status and warning messages transmitted by the monitoring module. , and it is almost direct to the user, through CLI commands, messages or messages to the user to report the system part warning information, and to give a solution to the recommendations.


Modules that can output information to SMS, report warning status, include IPMI modules, disk modules, pciece/me monitoring modules, power modules, and so on. There are differences in message format, content and message format and organization in different modules, which requires SMS to have good compatibility with the interfaces provided below, so that different modules can be connected smoothly. Also, considering the actual division of labor development process, as well as the increasing complexity of the system, this requires SMS must be guaranteed to have good extensibility, so that the new modules and functions easy to join in. In addition, there may be a higher level of application that needs to query some of the information that SMS collects. So, how do you implement all of these features? According to the author's experience, it can be considered from the following points:


1, the following sub-module Convention common interface function

In order to report the status information of the respective modules to the upper layer, the sub-modules each need to implement some functions, can be summed up in the public functions, defined as a cluster function operation, thus abstracting out the common interface. Each submodule only needs to implement these cluster of functions related to itself.


2, the following sub-module through the registration method to inform the upper module

Although the sub-module realizes its own cluster function, but obviously should not be called by the upper module directly, otherwise joins, deletes a sub-module, all need to add or remove and that sub-module corresponding function. Therefore, by registering the Submodule function cluster to the upper module of a function cluster array of methods, not only solves the previous problem, but also suddenly make the hierarchy between the upper and lower layers of the relationship at a glance.


3, the development of public warning statistics, imputation, archiving strategy

Multiple modules on the lower level will constantly detect the status of the hardware underneath it and record the information in their own domain. For this reason, the upper module can collect the state information or warnings of each module only by invoking the interface function provided to it by the underlying module, and then upload, archive, and so on, according to the specified policy (for example, whether the received warning, the number of event information exceeds the threshold, the information that has not been processed has timed out).


4. Provide abstract interface to external

In the actual project, SMS is usually used as a daemon process to keep running, and the system monitoring module under it daemon and so on to communicate with each other. In a real-world scenario, there may be an upper-level application that needs to know the total number and content of the system warnings, which requires SMS to implement some API library functions in addition to the daemon functionality for other applications to use.


Of course, these are just some of the things that need to be considered, but not all of them. An experienced design should also take into account the following questions:

1, in order to optimize performance, how to design data structure, to ensure that the upper module query ID continuous warning message priority from the storage space allocated by each module rather than the unified log file to query;

2, in order to facilitate the mode, speed up testing, how to start programming in the consideration of the various modules and systems of the test framework and code.

3, in order to better interact with the upper application, the library provided by the SMS itself needs those characteristics to ensure that the upper-level applications more efficient.


In a word, the design and development of the middle-tier service module, such as SMS, is to grasp its position, function and application scene from the macroscopic point of view, and from the business process and logic to the various sub-modules and relationships that it covers, as well as performance optimization, code debugging and test-driven development, in order to develop the correct function , and the system software with reliable performance.


This article from "Storage Chef" blog, reproduced please contact the author!

My opinion on the design of SMS

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.