Microservices vs dynamically linked libraries as plugins for a video management system

Our company is developing a proprietary video management system (VMS) written in C ++. In a new release, we want to allow customers to extend its functionality through the plug-in system. We will provide our plugins, but we will also give our customers an SDK so that they can write plugins themselves. Plugins receive the video stream (either uncompressed or uncompressed, so they do not need to decode it themselves), process it, and return metadata, connected to the images. A stream can be processed by several plugins.

  1. Streams must be processed in real time using as few resources as possible.
  2. Remote plugins should be possible.
  3. Customers should be able to write their own plugins.

I see two options on how the plug-in system could be implemented: microservices and dynamically linked libraries. Here are the descriptions of the solutions and advantages and disadvantages in my opinion.


VMS already broadcasts HLS streams, so it is not necessary to implement this part of the communication. Microservice (plugin) processes the video and sends the metadata via REST. If microservice is located on the same computer, it can send an uncompressed video stream in the form of frames using shared memory (to record a plugin stream decoding).


  1. A plugin can be written in any language.
  2. A plugin can work on the computer different from the box.
  3. A plugin crash does not cause the VMS crash.
  4. A plugin is relatively easy to code and debug.

The inconvenients

  1. For high speed on the same computer, it is necessary to implement communication via shared memory (and not a cross-platform and multi-language solution).
  2. Will work more slowly than DLL due to the IPC.

Dynamically linked libraries

DLLs are written in a special way (they export functions with specified parameters and names). They are loaded into the VMS. For each flow, an instance of the engine is created. For remote plug-in special servers, a conversation with VMS will be created.


  1. Will work faster than microservices.

The inconvenients

  1. A plugin must be written in a compiled language that follows STDCALL.
  2. It is necessary to write a special server for remote plugins.
  3. A crash of the plugin will cause a crash of VMS.
  4. A plugin is difficult to code and debug.

What is your opinion which solution is the best?