I'm watching : https://www.youtube.com/watch?v=qJXqQATJNTk
In my understanding, aws lambda functions are STATELESS. In the counter example, where is the counter atom stored ?
Does it auto setup dynamodb/auroradb in the background or something to store the data ?
So this was a bit of a hack :) The Lambda runtime keeps the process running the handler alive for some period, just like FastCGI back in the old days. In the demo, we used this aspect to store request count in a Clojure atom.
Normally one would store state in a database. But since the runtime keeps the process running the handler alive, one can do initialization, like say creating a database connection, that would otherwise cost too much to do on every invocation.
I think this process liveliness aspect makes things like http keep alive or sql database client side connection pools possible
So yes, Lambda is best though of as stateless, but a process fork for each event still would cost too much even nowadays :)
So in the demo, the process running the lambda handler kept the counter atom in memory. Iām pretty sure that there were multiple processes running, which resulted in multiple separate atoms, which you could call a demo effect š
last week Tatu used portkey in a livecoding event, but then with a RDS PostgreSQL, so the observed state was a bit more consistent š
Tracked is a strong word in this case.
But the idea is to deserialize the atom as a special implementation instead of a regular atom.
@qqq how would you like to use portkey?