Skip to main content

High Performance
Lambdas with Rust

Get In Touch

Write (or rewrite) your critical Lambda functions in Rust to boost performance and reduce cost.

Rust is a modern compiled language that excels in creating high-performance, memory-safe applications. Rust is a great fit for performance critical Serverless use cases with Lambda offering native C/C++ level performance with safety.

Why Rust?

Performance: Rust’s design prioritises efficiency, giving execution times and a memory footprint compatible to native C/C++. Rust performs significantly better than other application language stacks (e.g. Python, Node.js, C# and Java)
Safety: Rust’s focus on memory safety mitigates common bugs like null pointer dereferencing and buffer overflows prevalent in C and C++.
Correctness: Rust’s type system highlights fallible calls and data absence, aiding developers in identifying and handling edge cases explicitly.
Productivity: With a robust type system, refined compiler, and extensive developer tool ecosystem, Rust empowers teams to achieve more.

Download Overview

Benefits

  • Improved Performance: Rust can deliver a significant boost for performance-critical Lambda functions slashing execution time.
  • Lower Cost: Rust’s efficient execution characteristics and low memory footprint can provide a significant cost reduction for highly used Lambda functions.
  • Reduced Cold Start Impact: Thanks to its performance characteristics, Rust can significantly reduce the cost of cold starts. Typically, Rust cold starts are in the order of 10-50ms, as opposed to 500-2000ms generally observed in Python, JavaScript and Java.
  • Reduced Carbon Footprint: By adopting Rust for your performance-critical Lambdas, you’re not just optimising for performance – you’re actively contributing to more sustainable cloud deployments.

Why now?

Growth of Rust: The global Rust developer community surged to approximately 2.8 million in 2023. Major tech players like Google, Microsoft and AWS are actively adopting Rust for their critical infrastructure. fourTheorem were early adopters of Rust and are active in the Rust developer community.

Low-Risk Adoption: Lambda functions offer an ideal starting point for Rust adoption. Small and self-contained, they often have minimal dependencies and consist of only a few hundred lines of code. Migrating a single Lambda function to Rust is a low-risk investment, allowing you to test the waters without committing to a massive rewrite.

Benchmark Rust vs Python:
🚀 16x faster cold starts
⚡️ 3.5x less memory
💰 3x cheaper

Full details

Why fourTheorem? We wrote the book on it.

Crafting Lambda Functions in Rust

A practical guide on how to build efficient, sustainable, cost-effective serverless AWS solutions with the Rust programming language.

We have been building Lambda functions using the Rust programming language for a while now and we have seen impressive results in terms of efficiency, cost, and sustainability. In addition to that, Rust is a fantastic language with a great type system, which makes it easier to write elegant and correct code. Now, we are on a mission to share what we learnt so far. With this practical e-book you will learn everything there is to know to be able to write, test and ship Lambda Functions written in Rust.

Learn more
lambda-functions-in-rust-book

Have a Question

Get in touch with a member of our team below.