Modern stored procedures using GraalVM: invited talk

Modern stored procedures using GraalVM: invited talk
复制标题

使用 GraalVM 的现代存储过程:受邀演讲

DOI:
10.1145/3122831.3125717
复制
发表时间:
2017
期刊:
Proceedings of The 16th International Symposium on Database Programming Languages
影响因子:
--
通讯作者:
M. Brantner
M. Brantner
中科院分区:
--
文献类型:
--
作者:
M. Brantner

文献摘要

被引文献

相似文献

存储过程提供了一种方法来集中涉及多个SQL语句的业务逻辑,并在数据库管理系统中运行它们。它们通常在数据库的地址空间内执行。这样做有助于避免昂贵的网络往返,并通过直接访问正在处理的数据节省时间和内存。然而,尽管有这些好处,由于各种原因,使用存储过程通常被认为是有害的:(1)存储过程语言通常是特定于供应商的;(2)很难找到专门的存储过程语言的开发人员;(3)存储过程存储在数据库中,并且在现代版本控制系统中通常难以跟踪;(4)在其他编程语言之后通常缺乏工具支持。这次演讲的贡献有两个方面:首先,我们介绍了将多语言GraalVM嵌入到Oracle数据库和MySQL数据库中,以允许执行存储过程和用户定义函数。其次,我们将展示如何使用JavaScript作为存储过程语言来弥补上述缺点。GraalVM是一个由Oracle实验室开发的多语言虚拟机。GraalVM允许以非常高的性能执行许多现代编程语言,如JavaScript, R或Python。此外,GraalVM被设计成可以运行在Java虚拟机(JVM)上,也可以嵌入到Oracle数据库等不在JVM上运行的系统中。为了嵌入GraalVM并使用它来执行存储过程,它需要有效地访问存储在数据库中的数据。如果主机系统的类型(例如SQL类型)和存储过程语言的类型匹配,则不需要转换或复制数据。否则,需要在两种类型系统之间进行数据转换。我们将展示如何利用GraalVM提供的推测性即时编译器以最小的努力执行此类转换。在演讲中,我们还演示了如何在Oracle数据库和MySQL中使用JavaScript作为存储过程语言。JavaScript是当今最流行的编程语言之一,有一个充满活力的开源社区,提供了大量可重用的软件包。我们展示了在JavaScript中实现存储过程的有效开发工作流,以及开发人员如何利用流行的开源软件包。通过这种方式,我们希望弥补上面提到的缺点,并将存储过程带给更多的开发人员。
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.