Java Based Extension for Microsoft Open Sources SQL Server
Posted On April 30, 2020
Microsoft has open sourced the Java language extension it added to SQL Server 2019 last year.
Language extensions are used in SQL Server to allow users to execute code externally for queries.
The extensions leverage the Extensibility Framework API to communicate and exchange data with SQL Server.
Code execution is isolated from the core engine processes, but fully integrated with SQL Server query execution.
This particular language extension enables secure execution of Java code for a range of scenarios, such as performing advanced text and data preparation tasks, reaching out to external APIs to get data, and training machine learning models and model scoring.
Used in combination with the newly open sourced code of the this language extension, the Extensible Framework API provides an end-to-end example implementation of how a programming language extension can be built, explained Nellie Gustafsson, senior program manager on Microsoft’s SQL Server Product Team, in a blog post, which makes it easier for additional programming language extensions to be built for SQL Server by the community.
This evolved architecture will make it easier to upgrade the Java runtime, she noted, but it also raises some concerns around support.
(Enterprises need support contracts.) To address this concern, Redmond is partnering with Azul Systems. All Azure and SQL Server customers can now use Azul’s Zulu for Azure Enterprise distribution of Java for free, with support jointly provided by Microsoft and Azul. This supported distribution of Java is included with SQL Server out of the box.
Bringing Java workloads closer to the data opens a variety of possibilities, Gustafsson wrote. She listed a number of use cases for Java inside SQL Server:
This extends the T-SQL (Transact-SQL) surface area to better handle use cases involving regular expressions, string handling, and Natural Language Processing support.
This functionality also helps in migration scenarios from Oracle, where applications rely on Oracle Java procs in the database. With the ability to execute Java inside stored procedures in SQL Server, there is now a path for enabling Java application migrations to SQL Server.
Furthermore, this will help avoid unnecessary data movement and latency when data must be retrieved from SQL Server and moved into the app tier to do the business logic processing.