I know this is not what's happening here, but I just love the idea of a MySQL function where it spins up a new instance for every connection and promptly throws away the data after executing.
You can somewhat accomplish this with SQLite stored in S3.
Zappa (python) has a deployment configuration that allows this. It's basically a Lambda that keeps itself alive all the time and for each request, fetches the SQLite DB from S3, does its transaction, and then puts the modified database back on S3.
The upside is it's basically free for low traffic read-only apps, the downside is the obvious problem of write conflicts if you have more than one write-capable user at any given time.
If you were to use the django test framework to generate a new SQLite DB on each request, you'd have what you're talking about.
I've been contemplating pushing SQLite data files to my Lambda function via a custom layer. Individual executions can update within the scope of their execution, but you'd only get an update by pushing a new layer.
One fewer network hop compared to DynamoDB, and for something that might get an update once a week or even once a month I get low latency without having to oversubscribe to another service.
From playing with zappa/django and SQLite on S3, the first page load latency is still a thing even if the one Lambda is always alive, and I don't know why but have my suspicions. I didn't bother to performance test it much other than observation, since I was just using it for development to build an SES email newsletter system.
Comparing a read of a database driven app (going to the URL and getting the admin login in Django via Lambda/SQLite/S3) to an async javascript submission (submitting a form on a cloudfront static site that POSTs to DynamoDB), the javascript/DynamoDB round trip is faster by about a full second.
I suspect it's because of the simple bulk of the Django deployment. Putting the whole bundle on a Lambda with all of its dependencies was about 45-46 megs of crap, whereas a simple Node DynamoDB insert is a couple dozen lines.
So ultimately, while spiffy to play with, I didn't bother to use it much due to performance. Although it has been awhile, I heard that Amazon made some Lambda changes recently to address initial wake-up request performance.
Zappa (python) has a deployment configuration that allows this. It's basically a Lambda that keeps itself alive all the time and for each request, fetches the SQLite DB from S3, does its transaction, and then puts the modified database back on S3.
The upside is it's basically free for low traffic read-only apps, the downside is the obvious problem of write conflicts if you have more than one write-capable user at any given time.
If you were to use the django test framework to generate a new SQLite DB on each request, you'd have what you're talking about.