3 ms·
"Stateless: Functions as a Service is ephemeral, hence you can’t store anything in memory" This is more a characteristic of certain stacks rather than a trait
by matchagaucho 7y ago
"Stateless: Functions as a Service is ephemeral, hence you can’t store anything in memory"
This is more a characteristic of certain stacks rather than a trait of serverless.
For example, it's a common practice in AWS Lambda functions to cache DB connections using static variables.
- mjb 7y agoRight. I like to make a distinction here between "hard state" which needs to be persistent for correctness, and "soft state" which just needs to be around often enough for efficiency. Lambda's function re-use behavior, and the fact it lets you use static variables between invokes, is ideal for soft state. Data locality, and amortizing the cost of expensive operations across multiple requests, are still things that matter in the serverless world.