Live data from Hacker News

Serverless SQLite

sql.lspgn.workers.dev

31–40 of 167 posts

Re: Serverless SQLite

#31
post #4

What would this be best used for?

With this, suppose you want faster response than Disk, then every serverless function can have its own replica of data & power responses off of that. It is like a cache through sqlclient. But wait, can't we do that already running in memory SQLLite? why is it a big deal now?

Re: Serverless SQLite

#32

Earlier quoted context omitted.

Words can have multiple meanings and meanings of words can change.

Almost like how the English language has been literally hijacked and destroyed. Language does change and evolve. The misuse and subsequent additional meaning for “literally” to now also be a simile for “figuratively” is a good example of how this isn’t necessarily always a good thing.

Do you mean like "incredible" and the like?

It's just language, you might disagree but usage determines correctness (eventually).

Re: Serverless SQLite

#33
post #15

I have a Google Cloud Function that uses SQLite to store a user's previous day tweets and do some minor sorting and filtering of data. Works very well and saves me the cost of a "real" SQL instance.

Where's the SQLite database written? How do you ensure only one writer is modifying it?

Two-phase commit[0] could do the job

[0] https://en.m.wikipedia.org/wiki/Two-phase_commit_protocol

Re: Serverless SQLite

#34
post #16

Earlier quoted context omitted.

> SQLite was already serverless. Yes but now it runs on someone else server! Wait a minute, this makes no sense... 'serverless' is perhaps the stupidest marketing buzzword developers have come up with.

Indeed it's quite stupid. Any alternative catchy name for the concept?

Isn't the modern serverless just a "load on demand"-concept?

Re: Serverless SQLite

#35
I was thinking of making it possible for SQLite to be used with static pages.

My idea is to modify SQLite to use ajax with the HTTP Range header to fetch B+ pages from the server as they are needed. SQLite already has a VFS (virtual file system) so this shouldn't be too hard.

I am not sure how fast it would be and it would waste a lot of bandwidth. That's why I haven't made it yet.

This would only be useful for using it with Github pages.

Re: Serverless SQLite

#36
post #5

I've also experimented with this, unfortunately the 50ms CPU time isn't enough for datasets larger than 1.5MB. And the wasm init add at least 100ms to each request even when "hot" in cache. Also, out of a cost perspective, running a VM with SSD for cheap with SQlite will give much more requests than a CF worker for much less. Adding writes to this is also very limited due to the max 1sec write per KV key limit.

Mmm, the only use case I can see is equivalent to an in-memory database, which would be faster than embedding sqlite.

Re: Serverless SQLite

#37
post #6

SQLite was already serverless. https://www.sqlite.org/serverless.html

According to your link:

> Recently, folks have begun to use the word "serverless" to mean something subtly different from its intended meaning in this document. Here are two possible definitions of "serverless": Classic Serverless: [...] Neo-Serverless: [...]

SQLite was already "Classic Serverless". Now it's "Neo Serverless" as well.

Re: Serverless SQLite

#38

Earlier quoted context omitted.

Words can have multiple meanings and meanings of words can change.

Almost like how the English language has been literally hijacked and destroyed. Language does change and evolve. The misuse and subsequent additional meaning for “literally” to now also be a simile for “figuratively” is a good example of how this isn’t necessarily always a good thing.

The 'misuse' of literally has been part of the English language for almost 300 years at this point [1]. It is older than the USA.

[1] https://www.merriam-webster.com/words-at-play/misuse-of-lite...

Re: Serverless SQLite

#39
Using SQLite compiled to Wasm in order to push computation closer to the user is a powerful idea. I'm partial to the method of serving up the SQLite files directly and building applications around the SQL.js library [1], which includes math extensions and the ability to embed Javascript udfs. I wrote a data visualization using SQLite as the data store [2] and can attest that it's refreshing to use SQL inside of a static website.

[1] https://github.com/sql-js/sql.js [2] https://ml-ranking.geospiza.me

Re: Serverless SQLite

#40

Earlier quoted context omitted.

> the misused "literally" is to indicate exaggeration Used to be. Now "literally" literally means "figuratively". [1] [1] https://www.merriam-webster.com/dictionary/literally

From your link: > Can literally mean figuratively? > One of the definitions of literally that we provide is "in effect, virtually—used in an exaggerated way to emphasize a statement or description that is not literally true or possible." Some find this objectionable on the grounds that it is not the primary meaning of the word, "with the meaning of each individual word given exactly." However, this extended definitio…

You are correct. Literally is commonly used as an intensifier and has been for ages.

Complaining that modern people are literally ruining the word literally is a popular internet gripe.

Post reply on HN