MySQL 9.1.0
Source Code Documentation
Extending MySQL

Components

MySQL 8.0 introduces support for extending the server through components. Components can communicate with other components through service APIs. And can provide implementations of service APIs for other components to use. All components are equal and can communicate with all other components. Service implementations can be found by name via a registry service handle which is passed to the component initialization function. There can be multiple service API implementations for a single service API. One of them is the default implementation. Service API are stateless by definition. If they need to handle state or object instances they need to do so by using factory methods and instance handles.

To ease up transition to the component model the current server functionality (server proper and plugins) is contained within a dedicated built in server component. The server component currently contains all of the functionality provided by the server and classical server plugins.

More components can be installed via the "INSTALL COMPONENT" SQL command.

The component infrastructure is designed as a replacement for the classical MySQL plugin system as it does not suffer from some of the limitations of it and provides better isolation for the component code.

See Component Subsystem.

Plugins and Services

As of MySQL 5.1 the server functionality can be extended through installing (dynamically or statically linked) extra code modules called plugins.

The server defines a set of well known plugin APIs that the modules can implement.

To allow plugins to reuse server code the server exposes a pre-defined set of functions to plugins called plugin services.

See the following for more details:

User Defined Functions

Native code user defined functions can be added to MySQL server using the CREATE FUNCTION ... SONAME syntax.

These can co-exit with Plugins or reside in their own separate binaries.

To learn how to create these user defined functions see User Defined Functions