User-defined functions (UDFs) have been a fixture in database systems for a considerable period of time, allowing users to extend the database’s built-in functionality to complement good ol’ SQL. Although the traditional UDF is a powerful tool, developers are in most cases forced to use unfamiliar programming languages, typically unique to the database itself. However, with a portable, low-level binary format with sandboxed security controls and broad language support (WebAssembly!), there’s a new wave of UDF implementations emerging and we like what we see.
For example, Singlestore’s Code Engine provides users with the ability to create both UDFs and Table-Valued Functions (TVFs) using code compiled to Wasm, while both InfinyOn and RedPanda enable developers to manipulate data streams from within their platforms using Wasm. Our own Extism, the universal plug-in system, pulls back the curtains with a demo showing how to extend SQLite3 with Wasm UDFs. Let’s take a deeper look into what’s driving this trend, along with some thoughts and considerations for the future.