Hacker News new | past | comments | ask | show | jobs | submit login

WebSQL was killed by Mozilla and Microsoft. A huge idiotic mistake, probably related to the anti RDBMS NOSQL sentiment and fashion at that time. Browsers should ignore this crazy decision and keep (or add) SQLite in the browser - is still in Chrome but deprecated. SQLite is faster and way more capable than Indexdb and free and open source and runs on all platforms and devices - at least keep it as an option.



Mozilla and Microsoft both agreed that the web needs standards that are easy to implement multiple times, otherwise you wind up with another IE6 compatibility nightmare situation. Even though SQLite is open source, there's still only one SQLite. If browsers had to embed SQLite, then the web would have to deal with compatibility issues from SQLite bugs for decades.

It doesn't matter that IndexedDB is less capable than SQLite, it matters that IndexedDB is a well defined standard that can be easily implemented and optimized independently by each browser. It was polyfillable on day one on Chrome's SQLite install, and the other browsers were free to choose where and how to implement IndexedDB.

Also, IndexedDB has gotten quite fast in recent browser versions and is only getting faster, thanks to the browsers being able to compete on how they optimize it (versus all of them trying to pass competing PRs to SQLite, or working on increasingly divergent forks of it).

A goal for IndexedDB was that it might be low level enough that you could build RDBMS database APIs on top of it (whereas you're hard pressed to build certain types of key/value stores or document stores more directly on top of SQLite). The Browsers weren't anti-RDBMS, they were anti-lock-in to a single vendor's bugs. Microsoft learned from their IE mistakes, and don't want Chrome to repeat them (as hard as Google sometimes seems to be trying to make the same mistakes).


Yes standards are great and SQL is a fine example of this, but the standards don’t make anything - developers make stuff from tools and the software they write or build upon. It is stupid to handicap a browser, to throw away an incredibly useful, already made, battle tested piece of software (SQLite) just for the sake if the almighty standard! And to replace it with a feeble slow key value db. So we now have the ridiculous situation of umpteen man hours being wasted reinventing the wheel, trying to build relational databases on top of IDB, it’s crazy.


SQL is a terrible example of a standard. Half the major databases that support the "standard" can't even agree with each other on what the syntax is to window the number of returned results.

SQLite is partly so battle tested simply because once you start down the path of relying on it, it becomes tough to shift to another SQL "standard" database, because of tiny differences in dialect, and sometimes huge differences in performance characteristics.

MySQL/MariaDB and PostgreSQL are also, open source, battle tested pieces of software. Why would a browser stop at SQLite and not allow developers the power of an equally tuned, "full" SQL database, with additional power/capabilities/storage management capabilities? Would a browser have to reimplement SQLite's dialect on top of it to support that as an option? Would a browser need to implement SQLite bugs on top of PostgreSQL? Would you want to write a website that does feature checking to see if WebSQL is backed by SQLite or MariaDB on the user's machine and adjust its SQL queries for the different query engines?

Meanwhile, you can look at Redis, Cassandra, Riak, BigTable, etc: we have the technology to build really scalable key/value stores that can scale and perform incredibly well. We also have the knowledge of building higher level APIs on top of that and getting those to scale and perform well. IndexedDB's slow period was a brief adjustment period, and benchmarks indicate that calling it "slow" or "feeble" today isn't accurate. We're certainly on the path where IndexedDB's performance is only steadily improving, and again, we have the technology to insure that it can scale and perform extremely well given the investment.

IndexedDB is a more than adequate compromise to the tar pit that is decades of weirdly incompatible SQL dialects and database engines, and to the security nightmare implications that if there was a 0-day bug found in SQLite code you could take down every browser on the web with it had SQLite been blessed to be such a "standard" that every browser just integrated it directly.


On the security question of using only a single dependency for all browsers, an infinite loop exploit in SQLite appears: https://news.ycombinator.com/item?id=17964243


There's a very promising attempt to get WebSQL-like features to browsers: Relational Database Proposal. Proposal tries to solve limitations Lovefield library authors had to deal with. (Lovefield powers GMail Inbox if I'm not mistaken.)

https://github.com/arthurhsu/rdb

https://github.com/google/lovefield




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: