Lovefield – A relational database for web apps
google.github.io
google.github.io
> "With WebSQL being deprecated, and IndexedDB not providing structured queries, web developers need a tool to satisfy their structured query needs."
> "Web app developers need structured queries to work in the mobile world."
> "With IndexedDB ... there's a steeeep learning curve to make it useful for your app. Moreover, IndexedDB does not provide structured queries."
> "IndexedDB does not offer structured query features, such as sorting by multiple columns, or joining the results of multiple tables."
As someone that looked forward to WebSQL, this is painful to hear. Many of us realized the above from the beginning. Yet, some in the standards committee found a way to shoot down WebSQL, w/vague rationale such as "we don't feel it's the best path for the web".
Well, thank you. Instead of giving us one of the most well tested SQL implementations (SQL Lite) that addresses all of the above, and much more, we were shoved a harder to use, more verbose, and less powerful alternative (IndexedDB). And as a result, we're having to implement our own relational databases. In JavaScript. 4-5 years later.
No offense to Lovefield, but it represents everything wrong w/the decision to deprecate WebSQL and implement IndexedDB instead. It was also the single-most decision that made me lose faith in the standards committee.
The same is true of many other parts of the web. I'm glad O3D failed (I was on that team) and I'm glad something like Unity/X3D/VRML isn't built into the web. I'm glad instead we have something low-level like WebGL that people can build many and varied higher level solutions on (Three.js, X3D, Unity->WebGL, Unreal->WebGL, SceneGL, Babylon3D, Pixi.js, etc.) You pick the solution that best fits your project.
Lower-level building blocks are better IMO in most cases. They are easier to test. Have less incompatible edge cases and leave it up to devs to build or pick a solution that's right for their needs.
When I try to think of any product or service born of a standards committee that has been wildly successful, I can't think of any.
Standards committees are useful if the goal is to bring consensus-driven stagnation (and standards), so that things can evolve around a group of products/services rather than just individual products/services. But, there have been extremely complicated standards like some of those from OASIS: https://www.oasis-open.org/ that made developers waste countless hours trying to adhere when a high level of complexity wasn't necessary. And even well-used standards like SQL have not moved quickly enough with the times, e.g. if you look at the differences between the major databases (PostgreSQL, Oracle, SQL Server, etc.), there are still many DB-specific features that could be standardized.
> Instead of giving us one of the most well tested SQL implementations (SQL Lite) that addresses all of the above, and much more
I wish embedding PostgreSQL would get to the point that people would think of it before SQLite, especially in situations like this that are generic, because there is so much more that could be done with it. Here's one recent effort in Java: https://github.com/yandex-qatools/postgresql-embedded and a slidedeck from a few years ago from the postgres lead at VMWare with that team's experience: http://www.slideshare.net/jkshah/pg-conf-eu2013embedded
He says in a post submitted over HTTP, using DNS for name lookup, TCP for OSI layer 3 transport, implemented in client software via POSIX socket APIs, encapsulated in IEEE 802.2 frames traveling across IEEE 802.3 and IEEE 802.11-defined physical mediums, routed by BGP and maybe even some OSPF.
Come on. You really can't think of any?
off the top of my head: HTTP came from CERN and w3c was years later; TCP is the alternative to the stillborn OSI standard; POSIX is a relatively recent AT&T UNIX-clone standardization effort; Ethernet was from Xerox PARC (although most of a modern implementation is from the IEEE era)
Successful standards committees are just a group of implementing industry members. WebSQL, for example, was edited by Ian Hickson.
The work almost always predates the standards committee -- also just like WebSQL.
That's not to say a web-platform relational API (even one based on SQL) standard would be a bad thing -- I think it would be a good thing. And its not to say that using SQLite as a key part of the stack in an implementation of such a standard would be a bad thing, either. But "behave exactly as version n of SQLite behaves" is not appropriate for a Web API standard, any more than "behave exactly as version n of Internet Explorer" would be.
http://nolanlawson.com/2014/04/26/web-sql-database-in-memori...
I'm clearly missing something, but I can't be bothered to watch the videos - can someone TL;DR it for me, please.
For me I'd like to:
Firebase as backend. Sync user data to browser. Query user data elegantly in browser using select statements.
Also, without the replication and conflict detection.
Without an in-browser persistent database (we used WebSQL, with all the future risks), it would require some interesting workarounds (can you serialize multiple megabytes to local storage? how long will it take? will it rollback from a fault correctly?) or Phonegap type solutions.
Unfortunately concurrency is typically the last thing that people think about. Concurrency is the first thing we deal with in our database, because you are right, without it data gets corrupted.
It uses local storage
E.g. they assert that, despite having pure-native views (e.g. no Swing-style "one UI for all platforms"), they share ~70% of the client-side code across iOS/Android/web.
Which to me insinuates the reused code is probably things like the domain models, validation rules, and also online/offline data storage/sync logic.
E.g. maybe Lovefield was part of that cross-platform client-side storage architecture. But probably not since it's Javascript. (Which is fine, Google is a big place/lots of different apps/needs.)
Your speculation isn't that far off.
1: http://www.jooq.org/doc/3.6/manual/sql-building/sql-statemen...
The problem was that browser APIs require independent implementations to become standard. Chrome used SQLite for their WebSQL, which left Firefox without a good option. (Implementing a SQLite clone isn't feasible with their budget.) So, the standard was dropped.
It's a shame, because SQLite is a great tech.
1. https://www.schneier.com/blog/archives/2010/12/software_mono...
Somebody posted it: https://news.ycombinator.com/item?id=10199163
When all implementations have the same bugs/quirks then websites can end up (inadvertently) relying on these bugs, and this makes any future fixes or upgrades to the underlying sqlite very risky (almost guaranteed to break some sites on the net).
It's the situation IE6-only intranet sites ended up with: depending on every dark corner of a particular implementation, and then couldn't even work with IE7/8/9.
So similarly the WebSQL standard would de-facto freeze at some sqlite3 version, and wouldn't be able to upgrade to sqlite4/5/6 until all sites on the web are compatible, which won't happen (and we'd have "quirks modes" for websql versions, etc.)
The whole mess is largely avoided when there are multiple independent implementations. When each implementation has different bugs, then developers will notice that their code works in one browser, but not another, and see what's a bug and what is a feature.
This wouldn't have been possible without the work the Chromium team has done to achieve such complete compatibility between desktop and mobile versions. But unfortunately the browser is still stuck in the mentality that it's just a document viewer. I think we really need to wake up and make the browser into a proper deployment platform. I applaud efforts like this, even if I don't immediately have a need for such a thing, because they are doing the necessary work to push on browser developers to release the right features towards that goal.