Question

I'm trying to understand what microservices are and MINIX's microkernel architecture seems to be a good analog. (I'm a systems engineer.) In my understanding:

  • Microservices are like user space drivers

That applications don't ask the kernel to do all the work. Instead they send requests to various services (drivers) to eventually get the job done. If a service crash, it is easy to just restart it and hopefully recover the previous state. And other services are not efficient.

  • Microservices adds communication overhead

Like userspace drivers that needs more resource due to the extra IPC needed. Microservices will cause more HTTP/whatever protocol requests sent so it can ask other services to do work.

  • Microservices can be partially upgraded without downtime

Like in MINIX I can upgrade my EXT2 driver to also support EXT4 without rebooting. Microservices can allow some part of it to be upgraded while other part still runs properly (maybe the requests gets delayed, but heck).

  • Microservices does not need to speak HTTP.

Something like DBus (a ultra low latency RPC used by open source UNIX like BSD, Linux and MINIX) can also be used to build microservices.

Are my comparisons fair? Did I get anything wrong?

Was it helpful?

Solution

Your analogy is intereseting and heading in the right direction.

Microservices are like user space drivers

Yes and no:

  • Yes, like user-mode drivers, microservices provide an independent functionality in their own tiny and independent process. Minix drivers run as independent process to offer a functionality that would otherwise be (or at least run as a) part of a monolotithic kernel.
  • No, because user-mode drivers are archtiectured around the microkernel. Remove the microkernel and the full architecture is useless. The microservice archtiecture, is not a star around a central component, but a mesh. Every microservice has its value by its own. Shutting down any of them should still leave an overall system that provides some (less) value.
  • No, because microservices can be used to scale, so that you run several instances on different machines of the same service. I doubt that you would run in parrallel 2 keyboard drivers to increase throughput.

Microservices adds communication overhead

Yes, and it's a lot of message passing like on the Minix kernel. The API of microservices might however be of a higher level of abstraction, thius more complex, and based on more complex types. The communication overhead will be more significant than what you are used to for an OS microkernel with its device drivers. (and the overhead for switching between user-mode and kernel-mode, which was one of the performance reason why MINIX didn't become mainstream, can be neglected in comparison).

Microservices can be partially upgraded without downtime
Microservices does not need to speak HTTP.

Yes, exactly

OTHER TIPS

Your comparison is apt, but that is because you looked into the topics deeply and verified that it is. The mere fact that both concepts are called "micro-X" could have been deeply misleading, and often it will be.

Licensed under: CC-BY-SA with attribution
scroll top