Search code examples
architecturesystemsystem-design

How platforms enable custom plugins


I have a curiosity question that I cannot find any articles or blogs on. I am curious how some SASS platforms have built the ability for clients to create "plugins" that extend their platforms capability. For instance, like shopify.

If you know of any resources that I can read up on designs and/or system architectures, please comment them below!

Thanks!


Solution

  • Plugins are enabled by mainly two things:

    1. An Interface/API that is designed to communicate with the platform for all pluggable behaviors. Most often done via a scripting language interface, such as Javascript or Python. The API will often allow for calling to manipulate the platform in some ways as well as a form of event registration in order to execute the plugin code on specific platform events, e.g. "customer registered event" or "invoice sent event".

    2. A form of plugin registration and execution. Often via configuration files or conventions, such as plugin folder locations, specific interfaces, upload functionality etc.

    Security is always an important topic when designing a plugin interface. Some platforms will define their own domain specific language for plugins that is more restricted than a generic scripting language. Others will only provide a limited set of libraries that can be used.

    I also recommend to check this Stackoverflow Question and this openstack article describes the plugin-design-pattern with an example.