Live data from Hacker News

A future for SQL on the web

jlongster.com

41–50 of 227 posts

Re: A future for SQL on the web

#41
post #11

James is one of the world's great techno-adventurers, & getting to para-socially share in wild adventures like this makes living on Spaceship Earth more lovely & lively! James has also done cool projects like sweet.js macros, helped kick off Firefox devtool's transition to react (iirc), oh and lead the basically industry standard JS formatter Priettier project. I'm forgetting a dozen other things over the years but i…

Thank you!

Re: A future for SQL on the web

#42

    While in-memory databases have their uses, it kneecaps
    SQLite into something far less useful. To build any
    kind of app with it, we need the ability to write and
    persist.
Another approach than writing the data to a server could be to allow the user to store it on their own hard disk.

This could be done via the File System Access API:

https://developer.mozilla.org/en-US/docs/Web/API/File_System...

The API already works nicely in Desktop Chrome:

https://googlechromelabs.github.io/text-editor/

Re: A future for SQL on the web

#43

This is funny and sad to me. We had SQLite in the browser[0]. I only did a little bit of work with it but it seemed actually pretty nice. It was torpedoed because it was SQL-based (and not trendy "key value" and "web scale"). There was the whole excuse that the specification was "whatever SQLite does" and, therefore, not suitable for being a standard. There would be worse things than SQLite upon which to base a stand…

first thought, was there a "standard" for key/value stores? mongodb the reference implementation?

overall, if you looked at HN like five years ago, every DB headline was key/value, mongodb, maybe some cassandra / couchdb, links to the "web scale" cartoon.

these days, it's SQL SQL SQL, with a heavy dose of SQLite and PostgreSQL. SQL survived the key/value fad despite the nebulousness of a workable "standard" (yes there's a SQL standard but no vendor DB implements all of it or doesn't add many many features, syntaxes, and behaviors on top of it). In particular SQLite recently seems to look to Postgresql for guidance on new syntaxes such as how it implemented upsert, it's RETURNING syntax is explicitly from PostgreSQL, and it interestingly uses the same "VACUUM" term for db utility cleanup.

Re: A future for SQL on the web

#44

Earlier quoted context omitted.

Came here just to say this. Each SQL program needs to run on a blockchain so that there's no central authority that can unduly influence the data.

I legitimately can no longer tell if this was being suggested sarcastically, or if you guys are being serious.

The point is if the VCs can tell if we're being sarcastic or serious.

Re: A future for SQL on the web

#45
post #42

While in-memory databases have their uses, it kneecaps SQLite into something far less useful. To build any kind of app with it, we need the ability to write and persist. Another approach than writing the data to a server could be to allow the user to store it on their own hard disk. This could be done via the File System Access API: https://developer.mozilla.org/en-US/docs/Web/API/File_System... The API already works…

Did you read the post? This project does exactly that. (but focuses in IndexedDB for now because it's the only cross-browser thing that works. I actually tried a webkitFileSystem backend and it was slower)

Re: A future for SQL on the web

#46

> browsers may delete your IndexedDB database under certain conditions Safari will happily delete your IndexedDB database after 7 days of inactivity. It deletes "all of a website’s script-writable storage after seven days of Safari use without user interaction on the site". That includes: - Indexed DB - LocalStorage - Media keys - SessionStorage - Service Worker registrations and cache Source: https://webkit.org/blog…

Yep, this is the biggest problem (although I haven't seen it happen after 7 days, at least on desktop).

We will provide a new backend for the Storage Foundation API when it's available.

Re: A future for SQL on the web

#47

> browsers may delete your IndexedDB database under certain conditions Safari will happily delete your IndexedDB database after 7 days of inactivity. It deletes "all of a website’s script-writable storage after seven days of Safari use without user interaction on the site". That includes: - Indexed DB - LocalStorage - Media keys - SessionStorage - Service Worker registrations and cache Source: https://webkit.org/blog…

Tim Cook basically lied to Congress when he stated that developers can create web apps as an alternative to using the app store.

Edit: In order for this to be true, Apple (at the very least) needs to enable push notifications and an install prompt for progressive web apps.

Re: A future for SQL on the web

#48

> browsers may delete your IndexedDB database under certain conditions Safari will happily delete your IndexedDB database after 7 days of inactivity. It deletes "all of a website’s script-writable storage after seven days of Safari use without user interaction on the site". That includes: - Indexed DB - LocalStorage - Media keys - SessionStorage - Service Worker registrations and cache Source: https://webkit.org/blog…

I wish every browser does that! Web site has no business storing data on my computer more than 4093 bytes (that is already too much) per domain in my computer just because I visited a web page. 10 MB - 10GB of data is too much.

Re: A future for SQL on the web

#49

> browsers may delete your IndexedDB database under certain conditions Safari will happily delete your IndexedDB database after 7 days of inactivity. It deletes "all of a website’s script-writable storage after seven days of Safari use without user interaction on the site". That includes: - Indexed DB - LocalStorage - Media keys - SessionStorage - Service Worker registrations and cache Source: https://webkit.org/blog…

I would point out that the article you linked mentions that webapps "added to the home screen" on iOS Mobile Safari are exempt from this garbage-collection process. In such a case, the "add to the home screen" step is being taken as the user expressing the explicit desire to have that data around indefinitely. Which seems sensible to me; webapps should be treated as ephemeral-by-default, and only be allowed persistent storage if the user goes to lengths (i.e. beyond just clicking "Accept" on a modal) to express their desire to keep the data.

(And also, I've observed that webapps that notice they're on an iOS device can insist on being "added to the home screen" before they'll do anything, and so ensure their data stays around.)

The problematic aspect of this, is that there's no equivalent of this "exemption by user explicitly expressing the desire to keep the app around" for non-mobile Safari.

Maybe for desktop Safari, the data should be kept around if the web app's rel="canonical" URL is bookmarked in the browser?

Or desktop Safari could just support regular Progressive Web App standards, and so show an "Install App" indicator (like e.g. desktop Chrome does for this webapp: https://www.soundslice.com/). But I have a feeling Apple will never support this on desktop...

Re: A future for SQL on the web

#50
post #42

While in-memory databases have their uses, it kneecaps SQLite into something far less useful. To build any kind of app with it, we need the ability to write and persist. Another approach than writing the data to a server could be to allow the user to store it on their own hard disk. This could be done via the File System Access API: https://developer.mozilla.org/en-US/docs/Web/API/File_System... The API already works…

Did you read the post? This project does exactly that. (but focuses in IndexedDB for now because it's the only cross-browser thing that works. I actually tried a webkitFileSystem backend and it was slower)

Well, I woudln't call using IndexedDB "exactly that". As IndexedDB is rather fleeting. You don't use a server, that is correct. But IndexedDB goes away under many circumstances. Saving a file via the File System Access API would give the user peace of mind that it is safe. I did not see any mention of the File System Access API in your post.
Post reply on HN