A bit of obsession with the microkernel

Since I knew this term, I felt very mysterious at first, but I found it was not so unapproachable until I saw the examples on the Internet, and I found this idea was very common around us after I had a deep understanding of the main products around me, such as Webpack and Nginx. Microkernel system is generally divided into two parts — core system and plug-in system. The core system is aware of plug-in information through the registry.

After knowing several microkernel systems, I felt it was very practical, so I naturally wanted to apply this concept to my own projects, such as my Own Web projects. However, according to my own understanding, this may not be feasible, or even if forced implementation may not be pure. One of the questions is what about the registry? Microkernel systems typically have a configuration file that configures the plug-ins to be used in addition to the system parameters, and then a “compile” process that reads the configuration file and generates a registry, meaning that what plug-ins will be available after “compile” is finalized. Our regular Web projects are already packaged at run time, and which plug-ins are available or not are not known at the time of packaging. Or we delay the implementation of the registry. We can assume that all plug-ins are available, but how do they differ from user to user? We can read our own configuration after entering the Web project. It is usually possible to call the background interface to obtain different permissions and plug-in information of different users. This approach has some disadvantages:

  1. The difference of functions between different user operations requires the programmer to consciously complete the isolation when writing the code.
  2. To make it difficult for plug-ins to rely on each other, it is not desirable to have a process for traversing the required plug-ins.

I always want to develop a simple microkernel system by myself, personally think that only by developing one can I have a deeper understanding of the essence of microkernel. For example, to make an APP, there is a plug-in market, where you can choose to install various plug-ins and realize corresponding functions after installation. You can also try to use the interdependence of plug-ins, for example, there is an order system, a payment system and a notification system. When the notification system is enabled, The order system and the payment system can be notified through the notification system, otherwise it will go through the notification process of each system.

The above is just a part of my idea, and I will continue to improve it in the future.