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


Google Announces Cloud Deploy For Kubernetes Engine
27/09/2021

Google has announced a new managed application delivery service for Google Kubernetes Engine (GKE). Google Cloud Deploy is described as a managed, opinionated continuous delivery service that makes co [ ... ]



GitHub Enterprise Adds Centralized User Accounts
11/10/2021

GitHub has released a new version of GitHub Enterprise, along with the ability to use centralized user account management. The latest server adds features to improve developer experience and improve s [ ... ]


More News

square

 



 

Comments




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

Last Updated ( Friday, 21 November 2014 )