Abstract

Stored procedures provide a way to centralize business logic involving multiple SQL statements and running them inside a database management system. They are typically executed inside the address space of the database. Doing so helps avoid expensive network round trips and saves time and memory by having direct access to the data that is being processed.However, despite those benefits, the use of stored procedures is often considered harmful for a variety of reasons: (1) stored procedure languages are often vendor-specific, (2) developers for specialized stored procedure languages are hard to find, (3) stored procedures are stored in the database and often harder to keep track of within modern version control systems, and (4) tool support is often lacking behind that of other programming languages.The contributions of this talk are twofold: First, we present the embedding of the multilingual GraalVM into the Oracle Database and the MySQL database to allow for executing stored procedures and user-defined functions. Second, we show how the use of JavaScript as stored procedure language can remedy the above mentioned disadvantages.GraalVM is a multilingual virtual machine that is being developed by Oracle Labs. GraalVM allows for executing many modern programming languages such as JavaScript, R or Python with very high performance. Additionally, GraalVM has been designed to run on a Java Virtual Machine (JVM) as well as being embeddable into systems such as the Oracle Database that are not running on a JVM. In order to embed GraalVM and use it for executing stored procedures, it needs to access data stored in the database efficiently. If the types of the host system (e.g. SQL types) and the types of the stored procedure language match, this should happen without converting or copying the data. Otherwise, conversion of the data between the two type systems is required. We show how the speculative just-in-time compiler provided by GraalVM can be leveraged to perform such conversions with minimal effort.In the talk, we also demonstrate how JavaScript can be used as stored procedure language in the Oracle Database and MySQL. JavaScript is one of today's most popular programming languages with a vibrant open-source community providing a vast number of reusable software packages. We show an effective development workflow for implementing stored procedures in JavaScript and how developers can leverage popular open-source packages. With this, we want to remedy the above mentioned disadvantages and bring stored procedures to a larger developer audience.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call