portkey

Portkey: from REPL to Serverless in one call
qqq 2017-09-22T17:05:42.000182Z

I'm watching : https://www.youtube.com/watch?v=qJXqQATJNTk

qqq 2017-09-22T17:06:01.000087Z

In my understanding, aws lambda functions are STATELESS. In the counter example, where is the counter atom stored ?

qqq 2017-09-22T17:06:13.000243Z

Does it auto setup dynamodb/auroradb in the background or something to store the data ?

viesti 2017-09-22T17:30:39.000206Z

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.

viesti 2017-09-22T17:34:31.000246Z

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.

viesti 2017-09-22T17:35:29.000547Z

I think this process liveliness aspect makes things like http keep alive or sql database client side connection pools possible

viesti 2017-09-22T17:37:39.000399Z

So yes, Lambda is best though of as stateless, but a process fork for each event still would cost too much even nowadays :)

viesti 2017-09-22T18:03:12.000610Z

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 šŸ™‚

viesti 2017-09-22T18:04:16.000272Z

last week Tatu used portkey in a livecoding event, but then with a RDS PostgreSQL, so the observed state was a bit more consistent šŸ™‚

cgrand 2017-09-22T18:47:02.000408Z

Tracked is a strong word in this case.

cgrand 2017-09-22T18:47:44.000310Z

But the idea is to deserialize the atom as a special implementation instead of a regular atom.

cgrand 2017-09-22T18:49:13.000645Z

@qqq how would you like to use portkey?