MariaDB Server has long supported a flexible plugin architecture. Plugins allow developers to extend server functionality in areas such as data types, auditing, storage engines, information schema tables, and more. …
Continue reading \"Lowering the Barrier for MariaDB Plugin Development: Plugins in More Languages\"
The post Lowering the Barrier for MariaDB Plugin Development: Plugins in More Languages appeared first on MariaDB.org.
Lowering the Barrier for MariaDB Plugin Development: Plugins in More Languages appeared first on MariaDB.org
MariaDB Server has long supported a flexible plugin architecture. Plugins allow developers to extend server functionality in areas such as data types, auditing, storage engines, information schema tables, and more.
Today, MariaDB Server plugins are typically developed in C or C++, like the server’s codebase. At least for a while
Even with the current plugin-writing approach, familiarity with MariaDB internals is beneficial because it enables you to do things you otherwise cannot. But it is not required.
A new development idea, MDEV-40189: Support plugins written in various languages, explores whether MariaDB Server could make plugin development accessible from additional programming languages.
The idea is to investigate how plugins could be written in languages such as Rust, Python, JavaScript, or Lua, while still integrating cleanly with the existing MariaDB plugin infrastructure.
Why explore this?Supporting additional implementation languages could make MariaDB plugin development more approachable for a wider range of developers and use cases.
For example, it could make it easier to prototype new plugin ideas, experiment with integrations, or evaluate safer and more ergonomic development models in languages such as Rust. It could also help developers who are already productive in languages like Python, JavaScript, or Lua explore MariaDB Server extensibility without needing to begin directly with C or C++.
This would not replace existing native plugin development. C and C++ remain important for low-level, performance-sensitive server functionality. Instead, this work would explore whether MariaDB can offer additional paths for plugin authors where appropriate.
Possible implementation directionHow to export the plugin APISWIGThe MDEV suggests investigating SWIG as a possible approach to making the MariaDB plugin API available across multiple programming languages. This could provide a common foundation for generating bindings or wrappers that allow plugin authors to interact with the required MariaDB APIs from languages other than C or C++.
SWIG usually stands for Simplified Wrapper and Interface Generator.
bindgenAnother possible approach, especially for a Rust prototype, would be to use bindgen.
bindgen is a tool that generates Rust bindings for C or C++ APIs, most commonly from C header files.
While SWIG focuses on generating bindings for multiple programming languages, bindgen is more specifically used to generate Rust FFI bindings from C header files. This could make it possible to expose selected parts of the MariaDB plugin API to Rust code, allowing a plugin author to call MariaDB server APIs from a Rust implementation while keeping the low-level ABI boundary explicit.
Using bindgen would leave important design questions open. Generated Rust bindings are usually close to the original C API, which means that memory ownership, pointer lifetimes, callbacks, error handling, and server lifecycle integration would still need to be carefully designed. In practice, a useful Rust plugin interface would probably require a safe wrapper layer over the generated bindings, rather than exposing the raw bindings directly to plugin authors.
So bindgen could be a good candidate for Rust-oriented plugins, while SWIG may remain interesting for a broader multi-language binding strategy.
For interpreted languages, there is also a separate question: how should the language runtime be embedded, managed, or isolated? One possible direction would be a dedicated plugin type for “foreign language support,” responsible for managing the runtime and exposing a controlled interface to plugins written in that language.
MySQL MLEA useful reference point is MySQL’s JavaScript stored-program support, which integrates a JavaScript runtime through the Multilingual Engine (MLE) and GraalVM. In that model, developers can write stored functions and procedures in JavaScript, while the database server executes the code through GraalVM’s managed runtime. Although MariaDB plugins are a different extension point than stored programs, the MySQL approach is relevant because it illustrates one way a database server can embed a modern language runtime, expose database-facing APIs, and manage execution, type conversion, privileges, and runtime behavior within the server process.
Percona and V8Another useful comparison point is Percona Server for MySQL, which has introduced experimental support for JavaScript stored programs using the Google V8 engine. As with the MySQL/GraalVM example, this is not the same as MariaDB plugin development, but it is relevant because it shows another practical approach to bringing a modern language runtime into a MySQL-compatible server.
Open questionsTogether, these examples suggest that there are at least two separate problems to solve. The first is how to expose the MariaDB plugin API to code written in another language. This is where an approach such as SWIG could be useful: it could help generate bindings or wrappers, allowing plugin authors to call the required MariaDB APIs from languages other than C or C++. The second problem is how that foreign-language code is executed inside, or alongside, the server. For JavaScript, for example, that could mean embedding an engine such as V8. A broader polyglot approach could point toward something like GraalVM, while Python or Lua would raise their own questions about runtime integration. In other words, SWIG would not replace GraalVM, V8, or another runtime; it would address a different layer of the design. Even with V8 as a JavaScript engine, MariaDB would still need a clean and safe way to export the plugin API to JavaScript.

WebAssembly is another model worth considering. A WASM-based approach could provide a language-neutral execution target, allowing plugins or plugin logic to be written in any language that can compile to WASM. It could also offer a clearer sandboxing boundary than directly embedding a full language runtime in the server process. At the same time, a WASM approach would raise its own questions around host APIs, memory management, performance, packaging, debugging, and how much of the MariaDB plugin API could realistically be exposed through a WASM boundary.
There are several technical questions to consider:
A useful first step could be a small proof of concept focused on a narrow plugin type and a single target language. This would help evaluate the feasibility of the approach before expanding the scope.
For example, an initial prototype could demonstrate:
The goal of such an experiment would not be to solve every use case immediately, but to clarify the architecture, limitations, and next steps.
Interested in the challenge?This is an early-stage idea with room for exploration. If you are interested in MariaDB internals, plugin systems, language bindings, embedded interpreters, Rust, Python, JavaScript, Lua, or SWIG, this could be an interesting technical challenge to take on.
Do you have an implementation idea? Would you approach this with generated bindings, a dedicated language runtime plugin, a Rust-first prototype, or an entirely different design?
Take a look at MDEV-40189, share your thoughts, or try a small proof of concept. Practical experiments and design proposals would be valuable input to deciding whether and how MariaDB Server could support plugins written in multiple programming languages.
Thank you for using MariaDB Server.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | MariaDB Server Plugins: disabled functions | 0 | 8.43 | 06-07-2026 |
| 2 | Extending MariaDB with Native Aggregate Plugins: Laying the Groundwork for HyperLogLog | 0 | 9.04 | 16-08-2026 |
| 3 | MariaDB Contribution Statistics, January-June 2026 | 0 | 11.03 | 25-08-2026 |
| 4 | Lessons From 20 Years Hacking MySQL (Part 2) | 0 | 11.42 | 20-06-2024 |
| 5 | Extending pt-archiver with a Partition-Aware Plug-in for Fast Retention Policy Enforcement | 0 | 12.64 | 16-06-2026 |
| 6 | Programming Brain now available in Spanish | 0 | 5.1 | 14-12-2023 |
| 7 | MariaDB Java Connector 3.5.9, 3.4.3, 3.3.5, and 2.7.14 now available | 0 | 22.59 | 15-06-2026 |
| 8 | MariaDB Community Server Q3 2026 maintenance releases | 0 | 18.63 | 24-08-2026 |
| 9 | The “bus factor” risk in MongoDB, MariaDB, Redis, MySQL, PostgreSQL, and SQLite | 0 | 5.46 | 03-03-2026 |
| 10 | Why do we need databases and SQL? | 0 | 5.63 | 06-03-2024 |