One of the most exciting things about the Rust programming language is that it makes infrastructure incredibly boring. That’s not a bad thing, in this case. No one wants their electrical wiring to be exciting; most of us prefer the safety that comes with being able to flip a switch and have light to see by. For similar reasons, at AWS we increasingly build critical infrastructure like the Firecracker VMM using Rust because its out-of-the-box features reduce the time and effort needed to reach Amazon’s high security bar, while still delivering runtime performance similar to C and C++.
Though AWS has benefited from Rust for several years, we’re looking for ways to contribute in meaningful ways. As Shane Miller, Senior Software Engineering Manager at AWS, says, “Rust helps us deliver fast, robust services to AWS customers at Amazon scale,” and we’re committing to further strengthen a community that has greatly benefited us and our customers. This commitment has included code contributions to Rust and Tokio, a runtime for writing asynchronous applications with Rust, but our commitment to the Rust community goes beyond code. In partnership with more than 5,500 contributors to Rust, we contribute in a variety of ways, all intended to enable AWS and others in the Rust community to build systems with confidence.
In this post I’ll explain where (and why) AWS uses Rust, and how our contributions continue to evolve.
Rust’s popularity grows
Here at AWS, we love Rust, too, because it helps AWS write highly performant, safe infrastructure-level networking and other systems software. Amazon’s first notable product built with Rust, Firecracker, launched publicly in 2018 and provides the open source virtualization technology that powers AWS Lambda and other serverless offerings. But we also use Rust to deliver services such as Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (Amazon EC2), Amazon CloudFront, Amazon Route 53, and more. Recently we launched Bottlerocket, a Linux-based container operating system written in Rust. Our Amazon EC2 team uses Rust as the language of choice for new AWS Nitro System components, including sensitive applications such as Nitro Enclaves.
Why has Rust proved so popular at AWS and elsewhere? As mentioned, this comes down to Rust’s cardinal virtues: performance and reliability.
Because Rust does not require a runtime or garbage collector, it is able to achieve runtime performance similar to C and C++. At the same time, Rust uses a strict type system and ownership model to achieve compile-time verification of memory and concurrency safety, making the cost of testing and validating Rust implementations significantly lower than C/C++. Carl Lerche, a principal AWS engineer, says Rust and Tokio give AWS the ability to write services that respond fast, reliably, and that help us offer a better customer experience.
But there’s more to Rust than code. David Barsky, a software engineer at AWS, says that Rust really focuses on providing a great experience for people. “So much so, it attracted a whole of bunch of people to systems programming who’ve never done it before, myself included,” he adds. The Rust community is particularly welcoming, reaching out to those that haven’t traditionally participated in systems programming or open source.
For these and other reasons, we’ve looked for more ways to participate in the Rust community.
Building for the builders
In 2019 we announced our sponsorship of the Rust open source project. Such funding helped the Rust community to run ecosystem-wide regression tests with Crater on Amazon EC2, for example. It was good, but we wanted to do more.
Ultimately, open source communities like Rust are about people, and we started hiring Rust and Tokio committers to ensure they’d have the time and resources necessary to further improve Rust. This led us to build a team around Tokio, hiring contributors like Sean McArthur, Lucio Franco, Jon Gjengset, and Lerche to continue to work side-by-side with developers from Buoyant, Dropbox, Confluent, vector.dev, fly.io, and more.
More recently, we’ve been fortunate to hire key Rust maintainers such as Felix Klock. Given our dependence on Rust, we need deep in-house Rust expertise, just as we have with Java and other foundational technologies. Marc Brooker, a senior principal engineer at AWS, explains, “Hiring engineers to work directly on Rust allows us to improve it in ways that matter to us and to our customers, and help grow the overall Rust community.” At the same time, these investments for customers dovetail nicely with community priorities.
Let’s be clear: We understand that we are net beneficiaries of the exceptional work that others have done to make Rust thrive. AWS didn’t start Rust or make it the success that it is today, but we’d like to contribute to its future success. We are convinced that investing in the wider Rust ecosystem helps our customers and those who may never become our customers. That’s OK. That’s how open source is supposed to work.
“We’re not just hiring a couple of folks for Tokio and the Rust compiler,” Miller says. “Rust is a critical component of our long-term strategy, and we’re investing to deliver Rust engineering at Amazon scale. That includes developer tools, infrastructure components, interoperability, and verification.” And, as she’s quick to highlight that Rust is community-built: There have been more than 5,500 contributors to Rust since its inception, with an average of 350 contributors to each release.
At AWS, we are grateful to be part of this welcoming, productive Rust community. If you’d like to help make Rust even better, there are a number of ways for you to get involved. And if you’d like to join our team, please see the open positions on our Rust/Tokio team.