Lenses are a popular approach to bidirectional transformations, a generalisation of the view update problem in databases, in which we wish to make changes to source tables to effect a desired change on a view. However, perhaps surprisingly, lenses have seldom actually been used to implement updatable views in databases. Bohannon, Pierce and Vaughan proposed an approach to updatable views called relational lenses, but to the best of our knowledge this proposal has not been implemented or evaluated to date. We propose incremental relational lenses, that equip relational lenses with change-propagating semantics that map small changes to the view to (potentially) small changes to the source tables. We also present a language-integrated implementation of relational lenses and a detailed experimental evaluation, showing orders of magnitude improvement over the non-incremental approach. Our work shows that relational lenses can be used to support expressive and efficient view updates at the language level, without relying on updatable view support from the underlying database. INTRODUCTIONA typical web application is based on a three-tier architecture with user interaction on the client (web browser), application logic on the server, and data stored in a (typically relational) database. Relational databases employ SQL query and update expressions, including projections, selections and joins, which correspond closely to familiar list comprehension operations in functional languages. Relational databases offer data persistence and high performance and are flexible enough for a range of applications. However, the impedance mismatch between database queries and conventional programming makes even simple programming tasks challenging [Copeland and Maier 1984]. Languages such as C# [Meijer et al. 2006 2015], have partly overcome this challenge using language-integrated query, in which query expressions are integrated into the host language and type system.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.