Table of Contents
Fetching ...

Rel: A Programming Language for Relational Data

Molham Aref, Paolo Guagliardo, George Kastrinis, Leonid Libkin, Victor Marsault, Wim Martens, Mary McGrath, Filip Murlak, Nathaniel Nystrom, Liat Peterfreund, Allison Rogers, Cristina Sirangelo, Domagoj Vrgoc, David Zhao, Abdul Zreika

TL;DR

Rel presents a cohesive programming language for relational data that moves beyond the traditional sublanguage paradigm by unifying data and semantics in a single system. Built on graph normal form and Datalog-inspired recursion, Rel supports end-to-end application semantics, higher-order constructs, and libraries to enable programming in the large. It provides comprehensive tooling for aggregation, linear algebra, and graph analytics, all as libraries, and frames relational data as relational knowledge graphs conducive to semantic reasoning and LLM integration. The paper also articulates formal semantics, discusses practical deployment in industry, and outlines future directions including active rules, higher-order queries, and constraint databases, highlighting Rel’s potential to simplify enterprise data architectures.

Abstract

From the moment of their inception, languages for relational data have been described as sublanguages embedded in a host programming language. Rel is a new relational language whose key design goal is to go beyond this paradigm with features that allow for programming in the large, making it possible to fully describe end to end application semantics. With the new approach we can model the semantics of entire enterprise applications relationally, which helps significantly reduce architecture complexity and avoid the well-known impedance mismatch problem. This paradigm shift is enabled by 50 years of database research, making it possible to revisit the sublanguage/host language paradigm, starting from the fundamental principles. We present the main features of Rel: those that give it the power to express traditional query language operations and those that are designed to grow the language and allow programming in the large.

Rel: A Programming Language for Relational Data

TL;DR

Rel presents a cohesive programming language for relational data that moves beyond the traditional sublanguage paradigm by unifying data and semantics in a single system. Built on graph normal form and Datalog-inspired recursion, Rel supports end-to-end application semantics, higher-order constructs, and libraries to enable programming in the large. It provides comprehensive tooling for aggregation, linear algebra, and graph analytics, all as libraries, and frames relational data as relational knowledge graphs conducive to semantic reasoning and LLM integration. The paper also articulates formal semantics, discusses practical deployment in industry, and outlines future directions including active rules, higher-order queries, and constraint databases, highlighting Rel’s potential to simplify enterprise data architectures.

Abstract

From the moment of their inception, languages for relational data have been described as sublanguages embedded in a host programming language. Rel is a new relational language whose key design goal is to go beyond this paradigm with features that allow for programming in the large, making it possible to fully describe end to end application semantics. With the new approach we can model the semantics of entire enterprise applications relationally, which helps significantly reduce architecture complexity and avoid the well-known impedance mismatch problem. This paradigm shift is enabled by 50 years of database research, making it possible to revisit the sublanguage/host language paradigm, starting from the fundamental principles. We present the main features of Rel: those that give it the power to express traditional query language operations and those that are designed to grow the language and allow programming in the large.

Paper Structure

This paper contains 39 sections, 3 equations, 4 figures.

Figures (4)

  • Figure 1: Example database containing orders, products included in orders (with their amount), and product prices.
  • Figure 2: Syntax of Rel. Curlies around $\texttt{ \bfseries\color{darkblue} \{}\texttt{Expr}\texttt{ \bfseries\color{darkblue} \}}$ can often be omitted.
  • Figure 3: Semantics of Rel expressions.
  • Figure 4: Semantics of Rel Formulas.