Following is a list of some of the recommendations and best practices to follow:
- Optimize your code: Writing syntactically correct Lambda functions is one thing and writing optimized functions is totally another. For example, it's always a good practice to initialize any external services like DynamoDB, SNS outside your function code. The reason for this is simple, each time Lambda starts your code, the underlying container starts up. At this point, the code outside the handler runs first (initialization). When subsequent function calls are invoked, Lambda reuses the same container to run your functions and as a result you save resources and time by not instantiating the external services again.
- Versioning and aliases: As discussed before, versioning and aliases are a very important set of tools that you should leverage when creating and...