Ephemeral state

So, that's how a function can be invoked. What happens when the code finishes executing? When this happens, the function runtime is terminated. This includes access to the memory state and any temporary files that were created on the filesystem. In other words, everything is gone – state included. This means that if you need to maintain or keep track of a state, then this should be saved to a service that's external to the function, such as Amazon DynamoDB. 

Consult the DynamoDB developer guide to learn more about how to persist state (see the link in the Further reading section), or check out Chapter 5, Leveraging AWS Services, where we will leverage other AWS services with Lambda.

Functions also have a finite execution time. There is a soft limit that you can configure yourself, and there is a hard limit of 900 seconds (15 minutes). If your function is still executing at this time, it will be terminated regardless. Some might say this is a limitation of the service, but actually this is a design decision that encourages you to build your applications within the bounds of a serverless architecture pattern.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.75.221