Your company's cloud architecture leans heavily on Lambda functions to process e-commerce transactions. The functions must scale automatically and remain unaffected by the state of previous invocations. Currently, a function processes payments by using an external payment gateway and it must reliably handle transactions during peak hours. To ensure that transaction handling by Lambda functions adheres to a stateless design, what should be done?
Enable automatic scaling on the Lambda function to handle the increased number of transactions.
Store transaction state data in an external database or caching service such as Amazon DynamoDB or Amazon ElastiCache.
Use environment variables to store transaction state between invocations.
Configure the Lambda functions to process transactions asynchronously using an internal queue.