Nice, you can actually do something a bit more flexible using SQLite on AWS Lambda. "Just" mount an elastic file system (EFS) onto your functions. I wrote about it here: https://franz.hamburg/writing/shared-storage-for-lambda-func...
Did I read it right you get 1 second responses? Why even bother with lambdas? A t3 nano reserved instance costs 2 bucks a month or something! Surely most folks don't anticipate 1000x scaling in minutes? Coupled to elastic beanstalk you can get reaonable scaling as well!
Serverless SQLite
51–60 of 167 posts
Re: Serverless SQLite
#52What would this be best used for?
We use KV and workers to serve static data (json) to browser based code.
This could be used to filter, sort or aggregate that data before sending the client.
Perhaps for inventory / product lookup on a e-commerce site.
Re: Serverless SQLite
#53Client issued arbitrary queries is one of the use cases for GraphQL and publishing immutable data sets on the web is the main use case for Simon Wilson’s Datasette [2].
In-memory SQLite compiled to WASM works in the browser and Node.js too. In the future, we can expect proper ACID operations on any WASM runtime that supports fsync in WASI [3], a POSIX-like API.
Re: Serverless SQLite
#54Earlier quoted context omitted.
Indeed it's quite stupid. Any alternative catchy name for the concept?
"Shared hosting".
Re: Serverless SQLite
#55I 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…
Re: Serverless SQLite
#56What would this be best used for?
Re: Serverless SQLite
#57Earlier 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?
Re: Serverless SQLite
#58Nice, you can actually do something a bit more flexible using SQLite on AWS Lambda. "Just" mount an elastic file system (EFS) onto your functions. I wrote about it here: https://franz.hamburg/writing/shared-storage-for-lambda-func...
Did I read it right you get 1 second responses? Why even bother with lambdas? A t3 nano reserved instance costs 2 bucks a month or something! Surely most folks don't anticipate 1000x scaling in minutes? Coupled to elastic beanstalk you can get reaonable scaling as well!
Re: Serverless SQLite
#59Earlier quoted context omitted.
That could be a lot of round trips.
Yes. Maybe you could increase the sizes of B+ pages ? The only reason that databases use B+ trees rather than a red-black tree or avl trees is because of the overhead of reading data from the hard drive. This would be a interesting hack.
> The upper bound on [the number of keys on an interior b-tree page] is as many keys as will fit on the page.
I think a tricky part of this idea would be the locking. Usually SQLite relies on the locking of the underlying filesystem. You could add your own mechanism that causes a lock to be assigned to a single client connection, but what if it never unlocks? (On a single machine you can tell if the client process has crashed.) You could add a timeout but what if the client process then does respond?
Re: Serverless SQLite
#60For running a write-enabled DB on a CF worker a major problem is that the only storage option that I could find has really low write limits [0], 1000 writes a day for the free option. "Durable Objects" is a beta API, perhaps its transactional-storage-api [1] has better limits?
--
0: https://developers.cloudflare.com/workers/platform/limits#kv...
1: https://developers.cloudflare.com/workers/runtime-apis/durab...