Zero To Production In Rust
by Luca Palmieri · first published 2022
83% recommend14% neutral3% critical
Why HN recommends it
Hands-on, project-based walkthrough of building a production-ready Rust web API, covering practical topics like structured logging. Suits intermediate readers who know the basics and want applied backend practice.
Summarised by Claude from recommending comments
<em>Zero To Production</em> is the ideal starting point for your journey as a Rust backend developer. You will learn by doing: you will build a fully functional email newsletter API, starting from scratch. You'll learn how to: <ul> <li>Navigate and leverage Rust's crates ecosystem</li> <li>Structure your application to make it modular and extensible</li> <li>Write tests, from single units to full-blown integration tests</li> <li>Enforce your domain invariants using Rust's type system</li> <li>Authenticate and authorize users of your API</li> <li>Implement a robust error
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






Learning Rust, I use these 2: 1. Command-Line Rust: A Project-Based Primer for Writing Rust CLIs 2. Zero To Production In Rust (it's actually one project)
on “Ask HN: Books that teach programming by building a series of small projects?” ↗This book is good but I think it’s too hard for beginners. I would recommend to read ‘zero to production in Rust’ by Luca Palmieri first especially if you like more learning by doing approach
on “Rust for Rustaceans” ↗I'm not sure I agree with the article's premises. Rust can be difficult, yes, but it can also heighten developer productivity above other languages. In Go, I'd have to worry about whether I checked for exceptions via `if err != nil` everywhere, while with Rust, I can depend on the compiler telling me if I haven't done so exhaustively, via the Result type. Same for having algebraic data types or, w
on “Using Rust at a startup: A cautionary tale” ↗Yes, it's ready. Read Zero To Production In Rust by Luca Palmieri for best practices: https://www.zero2prod.com/
on “Is Rust Ready for the Web Yet? (2020)” ↗Read the actual “Rust Book” (basics), then “Rust for Rusteceans” (medium to advanced nuances of the basics), then “Zero to Production in Rust” (using the previous learnings in production). The “async rust” book is helpful for async, but it’s still a work in progress. I would suggest reading the documents on the tokio site as a substitute.
on “Rust Books Grouped by Level” ↗…resources listed here, check out OReilly's "Programming Rust" 2nd edition, arguably a better introduction and reference than the official book. If you're into backend web development, take a look at "Zero to Production" in Rust for an applied, hands-on approach to building a server.
on “Ask HN: Recommended Rust Resources?” ↗My 2c: Rust + Actix + Diesel + Tera is the ultimate CRUD app stack, especially now that there is the excellent zero2prod[1] book to refer to for people who have not built a significant CRUD app before. When you're writing a CRUD app the only errors you should have to worry about are logic errors. The above mentioned Rust stack is the only one that I've been able to achieve that experience with in
on “Using Rust at a startup: A cautionary tale” ↗I have written another comment for a similar question, so I will paste that below: --- I'm not sure I agree with the article's premises. Rust can be difficult, yes, but it can also heighten developer productivity above other languages. In Go, I'd have to worry about whether I checked for exceptions via `if err != nil` everywhere, while with Rust, I can depend on the compiler telling me if I have
on “How I got involved in the Rust community” ↗If you haven't also check out Zero to Production in Rust, it's an excellent book by the author of this framework.
on “A taste of pavex, an upcoming Rust web framework” ↗Getting into actix has been made easy by the excellent book - zero to production in rust (especially if you are a beginner in both rust and backend) https://www.zero2prod.com/
on “Actix Web: a small, pragmatic, and fast Rust web framework” ↗Love the mention of Zero to Production in Rust. Have read a few Rust textbooks at this stage and this one felt the most practical for my 9 to 5.
on “Books for Software Engineers in 2023” ↗Disagree, I have a web server in Actix that I would have written in TypeScript and Node, or Python and Django, or Ruby and Rails, and the Rust version is similarly high level but far faster and more efficient. I recommend people read Zero To Rust In Production if they want to build a web API in Rust. https://zero2prod.com
on “Rust concepts I wish I learned earlier” ↗Another example, let's say you're parsing a subscriber name for an email list, and you have a few checks such as whether it's too long, has whitespace, orcontains forbidden characters: pub fn parse(s: String) -> SubscriberName { let is_empty_or_whitespace = s.trim().is_empty(); let is_too_long = s.graphemes(true).count() > 256; let forbidden_characters = ['/', '(',
on “Idris: A Language for Type-Driven Development” ↗For backend APIs it absolutely makes sense, not only for the safety guarantees but also its type system which makes data flows much easier to reason about. I recommend the book Zero To Production in Rust in particular for learning about this, I finished it recently and at the end I had a production-ready backend API. https://zero2prod.com
on “Next Rust Compiler” ↗I'd probably recommend switching the latter two and reading "Zero to production in Rust" before "Rust for Rustaceans".
on “Rust Books Grouped by Level” ↗