News for hackers. Stuff that matters.
Re:NoSQL No More by SchizoDuckie on Friday April 11, 2014 @01:59PM (#7574404)
Hear hear!

Now can somebody convince the W3 and Mozilla that there's nothing wrong with implementing SQLite next to IndexedDB so that I can move forward without having to write an IndexedDB adapter for my clearly relational TV Show -> Season -> Episode data please?

https://github.com/SchizoDuckie/DuckieTV/blob/angular/js/CRU...

Foreign Relationships on foreign keys are not difficult

Many to many Relationships are not difficult

SQL is not difficult

Joining is not difficult

Grouping is not difficult

Now try to do that in IndexedDB / NoSQL, and suddenly you're in a world of hurt. It can work, but can it perform? Maybe. With time and patches. So wham, let's throw the option of implementing the probably most well tested piece of software (in the universe probably, see http://sqlite.org/testing.html ) out of the window.

Re:NoSQL No More by dragonwriter on Friday April 11, 2014 @02:11PM (#7574476)
> Now can somebody convince the W3 and Mozilla that there's nothing wrong with implementing SQLite next to IndexedDB

There's nothing wrong with implementing SQLite next to IndexedDB, and its not like W3 is going to send the Internet Standards cops to bust the browser vendors that have.

OTOH, there is something wrong with standardizing "whatever the version of SQLite happens to be used in the most recent version of Chrome happens to do" in a W3C spec. Speccing out an API and a specific supported subset/dialect of SQL for WebSQL that could support multiple independent compatible implementations would be appropriate (and it could even be based closely on what a particular version of SQLite does) -- but no one involved was interested enough in doing that to actually, well, do it, and that's why WebSQL ended up in limbo.

Re:NoSQL No More by SchizoDuckie on Friday April 11, 2014 @02:24PM (#7574553)
I really don't understand this argument. They were able to throw up IndexedDB support from scratch in a jiffy, but because something that actually works on nearly all platforms (including mobile!) happens to be Chrome's (??) that is a reason to hold back?

Sqlite has been around for almost 15 years now. It's time to adopt it as a standard. Even if they're not satisfied with it, they can easily put a 'draft' stamp on it and provide people with a working, well-tested way to use it today. Firefox already has the support for it since your internal settings and favorites are also stored in guess what.... SQLite databases!

What's even more confusing is that Mozilla is actually listed on the Sqlite.org webpage as a sponsor, but they refuse to land it in Firefox. All because of hipster politics and creative arguments like the one above.

Sure it can use work. Migrations suck. But it will never evolve any further as long as they refuse to adopt it.

Re:NoSQL No More by dragonwriter on Friday April 11, 2014 @02:38PM (#7574624)
> They were able to throw up IndexedDB support in a jiffy, but because something that actually works on nearly all platforms (including mobile!) happens to be Chrome's (??) that is a reason to hold back?

No, because the proposed spec did not actually specify the behavior in a way that was independently implementatble.

The spec did not specify the supported query language, either by simple reference to a specific version of the SQL standard (which would be problematic, because a complete and correct implementation of any, at least recent, version of the SQL standard is rare, and probably inappropriate for the use case), or by more complex reference-with-identified-exceptions, or by just listing out the supported features and expected behavior.

It was, therefore, not possible even in principle to have mutually-compatible, independent implementations (and all of the existing implementations just did "link to some version of SQlite and do whatever it does".)

> Sqlite has been around for almost 15 years now. It's time to adopt it as a standard.

Its a good, widely used, tool -- and one that is rapidly changing. But the whole point of web standards is to specify behavior in a way which permits mutually compatible, independent implementations. And WebSQLDB didn't do that, and didn't really seem to be progressing toward doing that.

> What's even more confusing is that Mozilla is actually listed on the Sqlite.org webpage as a sponsor, but they refuse to land it in Firefox.

SQlite is -- or has been, at least, not sure if it still is -- used in Firefox. What they haven't included in Firefox is a WebSQL database implementation, because they believe -- and rightly so -- that WebSQL database wasn't appropriate as a web standard, and didn't show any sign of heading toward something that would be appropriate as such a standard.

Re:NoSQL No More by frik on Friday April 11, 2014 @02:51PM (#7574700)
> It was, therefore, not possible even in principle to have mutually-compatible, independent implementations (and all of the existing implementations just did "link to some version of SQlite and do whatever it does".)

SQLite library is in public domain, has more lines of code test cases than lines of code C library code and its SQL API is stable. Plus the SQL language is well documented: https://www.sqlite.org/lang.html

W3C could also simply just fork SQLite at any time and modify the SQL dialect.

Mozilla and Oracle both are official gold sponsors of SQLite, both companies use the library in their own products though made a lot of effort to create IndexedDB and especially tried to deprecate WebSQL - nice job!

Microsoft has several embedded SQL libraries (JetBlue, JetRed, SQL Server Express) and it would be a piece of cake for them to modify the SQL parser a bit to the WebSQL SQL dialect.

Re:NoSQL No More by vertex-four on Friday April 11, 2014 @03:19PM (#7574900)
The point is that someone has to actually sit down and define the exact feature set that a WebSQL implementation is supposed to implement, such that a development team could sit down with a copy of the standard and no other code and implement their own WebSQL implementation from scratch.

The fact that SQLite is available is entirely irrelevant to any of this. The W3C can't just say "do it like SQLite does it" - that's not a standard. The WebSQL spec that exists says:

> User agents must implement the SQL dialect supported by Sqlite 3.6.19.

Unless someone actually sits down and goes through the standardisation process to define WebSQL properly, this is not the way to go, or the next thing will be "implement this tag like Firefox does".

Re:NoSQL No More by jeffdavis on Friday April 11, 2014 @04:00PM (#7575219)
To be more specific: let's say SQLite has a bug which manifests differently on different platforms. It would be impossible to adhere to the standard.
Re:NoSQL No More by SchizoDuckie on Friday April 11, 2014 @04:07PM (#7575262)
May I refer once again to http://sqlite.org/testing.html and the fact that it's running in the real world on millions of devices? This is a non-argument in this discussion! What if IndexedDB has a bug which manifests differntly on differnt platforms? You would refer to the specs, which can be tested.
Re:NoSQL No More by mrcsparker on Friday April 11, 2014 @10:13PM (#7576679)
I don't understand this argument. There is already a SQL standard. Start there.
Re:NoSQL No More by vertex-four on Saturday April 12, 2014 @06:53AM (#7577539)
The SQL standard defines far more than you'd want in a web browser, and I'm not sure anyone actually wants all of it. So someone has to sit down and define which bits to cut out, anyway... and then browser developers have to develop a database engine, which I'm fairly sure none want to do. We barely have any open-source software that implements SQL correctly as it is.
Re:NoSQL No More by SchizoDuckie on Friday April 11, 2014 @03:01PM (#7574773)
SQlite is -- or has been, at least, not sure if it still is -- used in Firefox. What they haven't included in Firefox is a WebSQL database implementation, because they believe -- and rightly so -- that WebSQL database wasn't appropriate as a web standard, and didn't show any sign of heading toward something that would be appropriate as such a standard.

Istill haven't seen any argument on why it isn't possible to freeze it at some point and agree on the fact that that's already an interoperable standard that works in the field right now.

This is IMO still an the result of a NoSQL biased group of people that decided to go another way for the sake of being cool. SQLite is specced and tested inside out and back and forth (LITERALLY!) You can write a spec on that better than you can write a spec on how IE 6 behaves.

Re:NoSQL No More by frik on Friday April 11, 2014 @02:21PM (#7574533)
So true.

It's still sad that because of Mozilla and Microsoft we have no SQL API in all HTML5 browsers :(

http://en.wikipedia.org/wiki/WebSQL

IndexedDB is fine for storing JSON objects, etc. but a relational database with SQL query syntax, indexes, etc. more powerful and means less code to write. With IndexedDB one has to reinvent the wheel to just get basic query features.

WebSQL is not deprecation, the W3C Working Group Note actually says:

  'This specification is no longer in active maintenance 
  and the Web Applications Working Group does not intend to 
  maintain it further'.
WebSQL is only available in Webkit based Browsers (Safari, Chrome) which means most mobile browsers.

As SQLite is in public domain, no company would "loose their face" if they choose to use it. They could fork off SQLite and change the SQL query syntax (parser) to whatever the W3C finds suitable. https://www.sqlite.org

Mozilla Firefox and FirefoxOS both already ship SQLite for years and can be accessed by its internal JavaScript API. And several Microsoft products already use it anyway (e.g. Forza Xbox games). Microsoft has of course also various other SQL database libraries like MS Access JetRed (http://en.wikipedia.org/wiki/Extensible_Storage_Engine ), MS Outlook JetBlue (http://en.wikipedia.org/wiki/Extensible_Storage_Engine ) and MS SQL Server Express (http://en.wikipedia.org/wiki/SQL_Server_Express ) the SQL backend originally forked off for WinFS for Longhorn (Vista beta). It would be trivial for Microsoft to choose one of its many SQL engines and add it to IE 12. The same goes for Mozilla (just expose the API of SQLite).

For some reason Oracle and Mozilla pushed IndexedDB. Oracle has conflicting interests, as it owns OracleDB(SQL), MySQL (SQL) and BerkeleyDB (NoSQL and now also SQL support, based on SQLite). Oracle is an official "sponsor" of SQLite development and even ships it as part of it's BerkeleyDB package: http://www.oracle.com/technetwork/database/database-technolo... and https://www.sqlite.org/index.html#consortium_members

Mozilla tried to explain why they prefer IndexedDB over WebSQL: http://hacks.mozilla.org/2010/06/beyond-html5-database-apis-... and by an Mozilla dev https://web.archive.org/web/20130723044210/http://blog.vlad1... (I generally like Firefox and FirefoxOS but not implementing WebSQL is one of the worst actions that of Mozilla org, IMHO).

One can speculate that a less powerful HTML5 API translates in the long run to more SQL server licenses for Oracle and Microsoft. If the web app devs cannot do the processing & storage on the client side, one has to do it on the server side.

Anyway, I hope that we get an SQL API for HTML 5.x that also Mozilla and/or Microsoft implements. As of now WebSQL works fine in Webkit based browser which includes Safari, Chrome, Opera and includes also 95% of all smart phones.