The first keynote of AWS re:Invent was all about performance. So we were pleasantly surprised to hear Peter DeSantis announce a new Lambda feature during his Monday night keynote at AWS re:Invent: Lambda SnapStart.
Here’s what we know so far.
What is Lambda SnapStart?
Lambda SnapStart virtually eliminates the cold start process by creating a snapshot of your Lambda function to bypass the usual initialization process.
One of Lambda’s biggest advantages—and what keeps developers coming back for more—is its ability to handle spiky workloads. In layman’s terms, its ability to handle unexpected and sustained increases in workload volume. But the biggest challenge for developers wanting to use Lambda is the cold start that occurs every so often. For those using Java, specifically, the long initialization periods make Lambda cold starts even more painful. especially in Java environments.
Until now at least. According to DeSantis, organizations using Lambda SnapStart should see a 90% improvement in cold start times.
How does AWS SnapStart benefit my organization?
By removing the biggest obstacle, AWS paved the way for more organizations to bring their workloads onto Lambda.
Why use Lambda?
Lambda is a serverless infrastructure platform that runs code when triggered by specific events. The idea is that developers can focus exclusively on the code and not worry about creating or maintaining the underlying infrastructure. So it’s popular with developers because of its flexibility. They can write code and get real-time feedback within minutes. And it’s popular with leaders because it can run with minimal operating costs.
With Lambda, AWS performs all the applications operational and administrative needs for you, including capacity provisioning, monitoring, running the front end web service, and applying security patches. Which drives four key benefits to organizations.
The pay-as-you-go model isn’t new for public cloud services, but Lambda’s is one of the most compelling for cost savings. EC2 instances have to be started to receive requests, so they are left on for long stretches of time—and you pay for them as long as they are on. Lambda gets you much closer to only paying for the code you want to run.
Lambda is specifically designed to only run when triggered. While it’s available 24/7, you aren’t paying for every second. Which makes this a great solution for services that have large peaks and valleys in traffic volume.
Built to scale
Lambda is built to instantly and automatically scale parallel executions up or down based on the number of requested concurrent executions. Once executed, all resources allocated to that function are automatically destroyed.
Supports multiple frameworks
Whether you’re running Java, Go, PowerShell, Node.js, C#, Python, or Ruby code—Lambda comes with native support for that language. You can also use additional programming languages when developing functions using the Runtime API.
On the whole, Lambda was designed for developers to quickly and easily publish application code with minimal overhead. Lambda SnapStart enhances those features, making AWS Lambda functions even more appealing to the most agile of development teams.
How does AWS SnapStart work?
Once you’ve enabled Lambda SnapStart, your function needs to run one time for the feature to take effect. After the standard initialization, Lambda SnapStart takes an encrypted snapshot of its state and caches that for future use. When the function is triggered again, Lambda SnapStart grabs the cached snapshot instead of running through the initialization phase to start up the function.
Lambda SnapStart is available to all Lambda users, but must be enabled before use. It currently works only for Java functions using the Corretto runtime.