Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Rust: Your Low-Risk Entry Point to R...

Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)

Ready to ignite your enterprise with Rust, but struggling to justify the investment? Performance isn't enough. Instead of massive rewrites, what if you could start small with a low-risk path to production? This talk shows you how. Discover the power of Rust & serverless as a fast, safe, and sustainable entry point, delivering significant short & long-term benefits. Walk away armed with compelling arguments to persuade your leadership and hands-on code samples to begin your Serverless Rust journey today.

Luciano Mammino

February 21, 2025
Tweet

More Decks by Luciano Mammino

Other Decks in Programming

Transcript

  1. jameseastham.co.uk loige.co Serverless Rust: Your Low-Risk Entry Point to Rust

    in Production James Eastham (he/him) Talking Serverless Datadog Luciano Mammino (he/him) Senior Architect Four Theorem
  2. AWS Lambda Azure Functions GCP Cloud Run AWS Fargate ECS

    Azure Container Apps EKS AKS GKE EC2 Azure VM Compute Engine Cloudflare Workers
  3. ÒIf you think Ôserverless firstÕ you aim to reduce your

    operational overhead as much as possible James Eastham
  4. The magic of Custom Runtimes! Runtime Handler (logic) Runtime API

    Poll for events Event (JSON) Execute (event) Response or Error Response or Error (JSON)
  5. 📝 Our first Lambda function in Rust - Create a

    new project - Install the lambda runtime - Write init code - Write handler code - deserialise event - add the biz logic - serialise response - Build it (Amazon Linux x86/arm64) - Zip it - Ship it
  6. And you should! 😉 Cargo Lambda is fantastic for: -

    Scaffolding - Local Testing - Compiling (and cross-compiling!) But for deploying your Lambda Functions (with the rest of your infrastructure) You MUST use a proper IaC tool! Check out the Docs to learn how: loige.link/cargo-lambda-iac
  7. A case study! A Lambda Authorizer in Rust! Authenticated Request

    Your backend Custom Authorizer Lambda API Gateway
  8. A case study! A Lambda Authorizer in Rust! - The

    original version was written in Python - Since it was one of the most invoked functions we rewrote it in Rust - The change lead to: - 30% less cold starts - 90% decrease Init time - 60% decrease Execution time - 70% less memory - 50% cost reduction
  9. A case study! A Lambda Authorizer in Rust! - This

    project is now open-source: github.com/lmammino/oidc-authorizer - And the benchmarks are available too!
  10. Summary - Rust and Serverless is a perfect combo! -

    It gives you - Great performance - Safety - Cost reduction - Environmentally friendly applications - Serverless applications are small: Minimum risk / investment - If you are on AWS: use Cargo Lambda - Now go build your next Serverless app, with Rust!