🦀 From Experimental to GA: Rust on Lambda and Our Road Ahead

The Rust Lambda runtime just hit 1.0 and GA 🚀 We break down what that really means (no, it’s not a managed runtime), share progress on our event-driven chapter + observability, and tease the next big release of Crafting Lambda Functions in Rust.

If you are reading this is probably because you bought a copy of the e-book “Crafting Lambda Functions in Rust” by Luciano Mammino and James Eastham: A practical guide on how to build efficient, sustainable, cost-effective serverless AWS solutions with the Rust programming language. If not, and this topic sounds interesting to you, check out the book website at rust-lambda.com.

Hello friend!

TLDR; for the busy ones: no new book release yet… but it is close, and it is going to be a big one. In the meantime, a couple of important things happened in Rust-on-Lambda land, and we promised ourselves (and you) that we would keep this communication channel more alive so you always know what we are working on and what is coming next.

So, without further ado, let’s get into the news. 🚀

The big news: the Rust Lambda runtime hits 1.0 and goes GA

The official announcement states that you can now use Rust to build business-critical serverless applications on Lambda, backed by AWS Support and the Lambda availability SLA, and that Rust is available in all regions, including GovCloud and China.

The accompanying AWS Compute Blog post walks through how to build and deploy Rust Lambda functions with cargo lambda, how the runtime polls the Lambda Runtime API under the hood, and how the lambda_runtime / lambda_http crates wire your handler function to incoming events.

Finally, the 1.0 release of the aws-lambda-rust-runtime crate on GitHub makes it explicit: Rust support is now GA and ready for production workloads.

The Rust Lambda runtime hits 1.0 and goes GA 🎉

Wait, what does this mean and are we getting a managed runtime for Rust?

Fair questions.

We always believed in the future of Rust and Lambda since day one, because the story looks too good to simply be ignored. But AWS took a bit of time to finally commit to supporting it.

In the last 2 years or so of building with the Rust Lambda runtime and its ecosystem of libraries and tools ( cargo-lambda, we love you!), everything has always felt very stable, reliable and ready for prime time, and it’s great to see that finally AWS thinks so too! This is definitely going to bring more attention and more adoption of this ecosystem, so more people will be reaping the benefits (and the joy) of building Lambda functions using Rust! 🤞

But some community folks who haven’t had a chance to try Rust with Lambda yet were a bit confused by the announcement and, understandably, it felt like AWS was promoting a new managed runtime for Rust.

So what is a managed runtime and how does it differ from what we have with Rust? 🤔 

A managed runtime is what you get for languages like Python and Node.js, which means you just write the event handler and ship it to the Lambda service and everything else will magically connect. You don’t have to think about updating to the latest patch of Node.js or Python, or how the underlying infrastructure wires your handler code with the event propagation mechanisms that power the Lambda service.

In reality, if you look behind the curtain, Lambda (the service) exposes a runtime API, which defines how a single Lambda instance interacts with the whole Lambda service: how to poll for a new event to handle and how to return a response (or an error) for that processed event. In managed runtimes, you don’t have to worry about this wiring logic, because AWS manages all of it for you, but for custom runtimes like Rust or Go, this is an important detail that you should understand. We spoke about this in detail in our talk Serverless Rust: Your Low-Risk Entry Point to Rust in Production at Rust Global in London early this year. If you are curious, you can watch the specific section on YouTube. For the crazy ones, we even show you how to build a custom runtime in… Bash! 😇

A custom Lambda runtime written in 22 lines of Bash code (including comments!)

So yeah, we are not getting a managed runtime for Rust, but for a few years there has been a library (aws-lambda-rust-runtime) that does all the wiring logic for us and now this library is considered GA by AWS!

Still not sure what this means? Astraea from the Lambda team put it very simply and effectively in a LinkedIn comment:

“It means that if you are having production issues we will be jumping in to help you, and that support for the crate has funding :)”

So, time to enjoy the news and to double down on the Rust ecosystem for Lambda! 🎉

Book updates: what we are working on

Now, on to the book itself! 📙 

We are hard working on two new chapters! Let’s see what they are about!

Chapter 8: Event driven systems with Rust and Lambda.

A tiny sneak peek of what is inside:

  • We start from the philosophy of event driven systems: why you might want them, and what tradeoffs you are really making

  • We map out the “eventing toolbox” on AWS: SQS, EventBridge, Kinesis Data Streams and friends, with a bit of taxonomy before we write any code

  • Then we dive into three concrete pillars:

    • SQS for reliable queues, worker patterns, and backpressure

    • EventBridge for pub/sub and integrating multiple services in a loosely coupled way

    • Kinesis Data Streams for ordered, high-throughput event streams

And of course, we do all of this in Rust with real Lambda functions. We also upgrade our URL shortener so it behaves like a grown-up system:

  • No more doing everything synchronously in the request path

  • Offloading crawling, click tracking, and other “nice but not urgent” work to asynchronous flows

  • We make our code more extensible and make it easy to add new functionality in the future without big breaking changes.

We admit this chapter is turning into a bit of a monster (hopefully for the best). We would not be surprised if it gets close to 100 pages, but the goal is that they are 100 very dense and practical pages, not fluff. We are also adding a lot of diagrams to make the concepts click. For the impatient ones, here’s a sneak peek of one of those diagrams: 😅

Yes, you are reading this right, there are (at least) 20 figures in this new chapter!

Chapter 9: Observability for Rust Lambda functions

And here’s a little peek at what’s coming in the observability chapter:

  • Why you need to care about observability?

  • What is observability (sneak peak, you don’t need logs 😉 )

  • The challenges with observing serverless and event-driven systems

  • Open Telemetry and the power of standardisation with semantic conventions

  • Implementing Open Telemetry in Rust

  • Challenges with traditional approaches in serverless

  • Observability on your local machine

  • Dealing with PII data

  • Opinionated guidance on your serverless observability strategy

As with every other chapter you’ll be doing this in the context of our URL shortener application, for both the synchronous and asynchronous components. Whilst it’s not quite getting as monstrous as the previous chapter, it’s still coming in pretty big.

When is the next release coming?

Yes… But when?

We do not have a hard deadline to share right now. This book is still our side project, and we squeeze it in around full-time jobs and life… Which means lots of early mornings, late nights and carving off time from our weekends 😅 …That said, this book has firmly moved into “high priority side project” territory.

Our current goal is to ship the next release in roughly within the next three weeks. That timeline is still a bit fuzzy because, as we said, evenings, early mornings and weekends are our writing slots, but we are actively working toward it.

As always, thank you for your patience and for sticking with us while we try to do this properly rather than quickly.

Your support means a lot to us and we hope this book will turn out to be the Rust Lambda guide you deserve!

… And we admit we secretly hope this book goes beyond just Rust and Lambda to become a great read for those who want to master the bigger topic of building serverless applications on AWS! That’s why we are putting tons of effort into not just giving you the code snippets, but also carefully introducing the main components of the ecosystem (API Gateway, DynamoDB, SQS, EventBridge, Kinesis, CloudWatch, and more!) and how to connect everything together, considering pros and cons and different architectural patterns.

How you can help 🤲 

This project has already been shaped a lot by your feedback, and we really want to keep it that way.

If you want to help:

  • Tell us what works and what does not.
    If you spot typos, confusing sections, or places where you think “wait, this could be explained better,” please let us know.

  • Show us your Rust + Lambda creations.
    If you are building something with Rust on Lambda, we would love to see it. Share your projects in our Discord community, or just hit reply with a short description and links. With your permission, we might feature some of them as examples or case studies.

  • Join the conversation on Discord.
    The Discord server is where we bounce ideas, discuss patterns, and occasionally rant about tooling. If you are not there yet, this is your invitation to join, say hi, and tell us what you would like to see more of in the book.

Thank you again for reading, for experimenting with Rust on Lambda, and for keeping us accountable and motivated to make this book the most practical guide we can.

Onward, upward, and async 😃 
— Luciano and James

Reply

or to participate.