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.

Banner


Amazon Luna Goes Live
06/11/2020

Amazon has launched Luna, a cloud gaming service that it says game developers can use to reach multiple endpoints from a single source.



More AWS on Coursera and edX
12/11/2020

Amazon Web Services has announced additions to its range of training options. Two free self-paced courses, one on AWS IAM, Identity and Access Management, and the other on AWS IoT, using Ama [ ... ]


More News

square

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 21 November 2014 )