3 ms·
It's typically fine - AWS bills by GB/s (in ms), not by number of functions in an account. There are limits to the number of functions per account, and number
by astuyvenberg 4y ago
It's typically fine - AWS bills by GB/s (in ms), not by number of functions in an account.
There are limits to the number of functions per account, and number of resources per CloudFormation stack (etc); but within those parameters it's usually a good idea to use one function for a specific controller or action. This allows you to limit IAM permissions, configure memory/CPU, and define associated resources at a per-controller level.
- aa_memon 4y agoI'm guessing it also helps keep deploys small (atomic?) when a controller method changes. The unmodified lambdas stay untouched.
- bigfoot675 4y agoYou will definitely run into more cold starts though, if that is a consideration for your project
- philwelch 4y agoA serverless function that never cold-starts is just a container.
- KyeRussell 4y agoThat doesn’t mean that more cold starts aren’t bad.
- philwelch 4y agoSure but if you can’t tolerate the added latency of a cold start, serverless might not be right for you. Conversely, if you’re doing something like processing message queues and you don’t care about latency at all, serverless is perfect.
- foolfoolz 4y agothis makes logging much more difficult to search through