UCLA Researchers Develop Prela to Replace Verbose SQL Joins
The new query language uses binary relation composition and 6NF decomposition to simplify complex data retrieval.
Researchers at UCLA's RePL lab are developing Prela, a new query language designed as a composable and concise alternative to SQL. By rethinking how data relations are structured and queried, the team aims to eliminate the syntactic overhead and redundancy associated with traditional relational databases.
At its core, Prela operates on the principle of using only binary relations—tables consisting of exactly two columns. This approach allows queries to be constructed through relation composition. To achieve this, Prela employs Sixth Normal Form (6NF) decomposition, a process that breaks down wide tables into multiple binary relations. The language utilizes a join operator (&) and relation composition (via .select or .s) to manage complex filters and multi-column results. The efficiency of this logic is demonstrated by the fact that a toy implementation of Prela's core engine can be written in approximately 11 lines of Python code.
The Shift from SQL Verbosity
Traditional SQL often requires developers to write verbose JOIN statements and redundant conditions to navigate relational schemas. As queries grow in complexity, the resulting code becomes difficult to read and maintain. According to the project's official tutorial, a specific movie search query that spans over 20 lines in SQL can be expressed significantly more concisely in Prela.
Prela solves this by treating relations as nondeterministic functions. This allows developers to chain operations together, mirroring the logic found in functional programming rather than the declarative, often repetitive structure of standard SQL. By shifting the paradigm, the language removes the need for the repetitive boilerplate that typically plagues large-scale SQL scripts.
Implications for Data Engineering
If successful, Prela could fundamentally simplify how developers express complex relational queries. By replacing cumbersome JOIN syntax with intuitive composition, the language reduces the cognitive load required to write and debug complex data retrievals. This shift could lead to faster development cycles and fewer errors in the construction of intricate database queries, as the logic becomes more transparent and easier to audit.
Future Outlook
While the core logic is demonstrated through a concise Python implementation, the broader adoption of Prela will depend on its performance and scalability compared to established SQL engines. Observers will be watching to see if the RePL lab expands the language's capabilities beyond its current core logic or integrates it with existing database systems to prove its utility in production environments. The transition from a theoretical model to a production-ready tool will require rigorous benchmarking against industry-standard relational database management systems.