Microkernel (plug-in) architecture
A microkernel (or plug-in) architecture has two parts: a minimal core system that provides the essential, stable behavior, and plug-ins that add features through a defined contract. The core knows how to find, load and call plug-ins, but nothing about what each one does.
You use this style every day. Code editors and IDEs (VS Code, Eclipse, IntelliJ), web browsers, build servers like Jenkins and design tools all have a small core and a large ecosystem of extensions. It’s equally useful in business systems where the rules vary by customer, product, country or regulation, such as insurance claims, tax calculation, payroll or loan pricing.
(It’s named after, but distinct from, the microkernel in operating systems, which keeps only minimal services in the kernel and runs the rest outside it.)
Diagram
Section titled “Diagram”- Users work with one product; the core handles the shared, stable workflow.
- When behavior varies, for example claim rules by state, the core calls the plug-in registered for that case.
- New plug-ins, including third-party ones, can be added without changing or redeploying the core.
How it works
Section titled “How it works”- A minimal core. Only what every use needs: the main workflow, the plug-in loader, and shared services such as security, logging and configuration.
- A plug-in contract. Interfaces (or message schemas) that plug-ins implement, plus metadata: name, version, which core versions it supports, and what it extends.
- A registry. The core discovers which plug-ins are installed, from configuration, a directory, a database or a marketplace, and which one to use in each situation.
- Connection styles. In-process (Java service loaders, OSGi, .NET assemblies, scripting engines), or remote (each plug-in is a service called over HTTP or messaging), which gives stronger isolation at the cost of latency.
- Isolation. A faulty plug-in shouldn’t crash the core: sandboxing, timeouts, resource limits and the ability to disable a plug-in quickly.
- Rules engines are a common case. A business rules engine is effectively a microkernel whose plug-ins are rule sets.
- Extensibility: new features or variations without touching the core.
- Customization per customer or market, with each variation isolated and testable.
- Ecosystems: third parties can build on your product.
- Stability: the core changes rarely, so it’s well tested and reliable.
- The contract is hard to change: every plug-in depends on it, so breaking changes are very expensive.
- Designing the core is hard: too small and plug-ins duplicate logic; too large and it stops being a microkernel.
- Plug-in quality varies, especially from third parties, and can affect performance and security.
- Testing combinations of core and plug-in versions grows quickly.
When to use it
Section titled “When to use it”- Products that need customer-, market- or regulation-specific behavior on a common workflow: insurance, tax, payroll, benefits eligibility, lending.
- Platforms and tools meant to be extended by others.
- Systems where a stable core and fast-changing rules have very different release cycles.
When to avoid it
Section titled “When to avoid it”- Systems without real variation; a plug-in mechanism adds indirection for no gain.
- When the “plug-ins” need deep access to each other or to core internals, the boundary is in the wrong place.
Common pitfalls
Section titled “Common pitfalls”- A leaky contract that exposes core internals, so every core change breaks plug-ins.
- No versioning of the contract, leaving no way to evolve it safely.
- Plug-ins that depend on other plug-ins, recreating a tangled monolith around the core.
- Business logic creeping back into the core “just this once” for one customer.
- Untrusted plug-ins running with full privileges.
In practice
Section titled “In practice”- Public-sector benefit systems, where rules engines hold policy that changes every session
- Lending and loan origination, with versioned decision rules
- Shopify builds a modular monolith, which also exposes a large app ecosystem around its core
Related patterns
Section titled “Related patterns”- Modular monolith
- Hexagonal architecture, whose ports and adapters apply the same idea at the edges
- Layered architecture
Glossary: coupling
Further reading
Section titled “Further reading”- Mark Richards and Neal Ford, Fundamentals of Software Architecture (O’Reilly, 2020), chapter on microkernel architecture
- Visual Studio Code, Extension API (opens in a new tab)
- Eclipse Foundation, Equinox (OSGi) (opens in a new tab)
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.