Google Lovefield Relational Query Engine
Written by Kay Ewbank   
Friday, 21 November 2014

Google has released Lovefield. an open source JavaScript SQL-like database library for web developers. You can check it out on GitHub.

Lovefield is a database query engine built using IndexedDB as a backend that gives you a SQL-like declarative syntax to make it easy for developers to learn. You query the database using JavaScript function calls, and the developers say that its declarative form provides immunity to SQL injection attacks, since there is no query parsing involved. The library offers cross browser support for Chrome, Firefox, and IE10.

The case for a SQL data store for web development is an interesting one. Developers can make use of Web Storage, but that’s limited to key-value storage. An alternative is Indexed DB, but it is again object-and lacks traditional relational database features. Earlier versions of Google Chrome used to support the W3C’s WebSQL Database API, but work on this stopped because all the implementations that used WebSQL used SQLite as the back end, and the W3C said that “we need multiple independent implementations to proceed along a standardization path.

The language of Lovefield is a rather limited subset of SQL that lets you write select, insert, update, and delete queries, and provides atomicity for transactions. You can make use of integrity constraint checks using primary keys, unique values, and specify whether columns can be null or not. Aggregation operators include count, min, max, sum, avg, stddev, and distinct. The Select operator can have a Group by clause, and you can set up multi-table joins.

Google says that Lovefield includes a query optimizer that will evaluate different execution plans and pick the most promising. On the Google Open Source blog, Demetrios Papadopoulos of the Chrome team states:

“We are confident that current performance will satisfy the majority of use cases (less than 50k rows) and we plan to further improve the performance for larger datasets in the near future.”


Papadopoulos also says that Google is working to provide more advanced features such as foreign keys, cascaded delete/update, self-table join, and observers/data-binding “ in the near future”. There are no plans to add more advanced SQL features such as views, cursors, triggers and subqueries.

According to the blog post, Lovefield is already powering a few Google services, including Google Play Movies Chrome app. The team hopes that by releasing the library to other developers, they’ll enable the development of data-rich applications, and attract interest and feedback from developers. The feedback will be used in working out how to move forward with the project.


GraalVM's Alignment With OpenJDK Signifies A New Era For Java

Oracle will be contributing GraalVM Community Edition Java Code to OpenJDK. There's a lot behind this simple statement. But before that, let's first look at what GraalVM actually does.

Forward Planning For Google Summer of Code 2023

November might seem somewhat soon to be thinking about next year's Google Summer of Code - but if you want to participate, either as a new contributor or as a new open source organization then its cer [ ... ]

More News





or email your comment to:

Last Updated ( Friday, 21 November 2014 )