The ephemeral nature of AWS Lambda functions might have you believe that techniques like in-memory caching cannot be utilized like you would with a conventional server, but that’s not the case! Let’s check out why.
TJ Holowaychuk on Medium.com
Even though you can't fully rely on them, our experimentation has shown that global variables can be used for some opportunistic caching. Amazon Lambda launches a number of computer instances to run function invocations, and keeps them alive for an unspecified period of time, which may be several hours. During this time, Lambda functions can access cached data previously stored in global variables. When a function invocation happens to run on a fresh instance, data has to be fetched from a more persistent source again.
Amazon AWS Lambda data caching solutions compared
TJ Holowaychuk on Medium.com
Even though you can't fully rely on them, our experimentation has shown that global variables can be used for some opportunistic caching. Amazon Lambda launches a number of computer instances to run function invocations, and keeps them alive for an unspecified period of time, which may be several hours. During this time, Lambda functions can access cached data previously stored in global variables. When a function invocation happens to run on a fresh instance, data has to be fetched from a more persistent source again.
Amazon AWS Lambda data caching solutions compared
Comments
Post a Comment