Zero To Production In Rust

A hands-on introduction to backend development in Rust

If you want to learn how to use Rust for backend development, this is the place.

Rust's adoption is at an all-time high: more and more companies are trying it out and hiring for it.
If you are interested in building APIs with Rust, Zero To Production is the ideal starting point for your Rust journey.
You will learn by doing: we will start from scratch and build together, step by step, a fully functional email newsletter backend API.

You'll learn how to:

  • Navigate and leverage Rust's crates ecosystem
  • Structure your application to make it modular and extensible
  • Write tests, from single units to full-blown integration tests
  • Model your domain using the type system to enforce invariants
  • Collect logs, traces and metrics to observe the state of your application
  • Set up a robust continuous integration and continuous deployment pipeline for your Rust projects

All code comes attached to the book, tests included.

Buy early access £35 Download sample
Book cover

Early Access

Zero To Production In Rust is not complete yet - you will get early access!

You will get immediate access to the first six chapters (185 pages) in PDF, ePUB, MOBI.

All the source code is attached.

A new chapter is released every three/four weeks. The book should be complete in 2021.

You will be notified and be able to download new chapters as soon as they are ready!

Reddit avatar

Gilgw on Reddit

“One of the best introductions to Rust for web devs”

This has the workings of being one of the best introductions to Rust for web devs: the explanations are really clear and almost of all my questions get immediately answered in the very next paragraph, as if the author was secretly a mind reader.

Released Chapter Overviews

Foreword

Chapter Zero

Setting the stage: what is this book about? Who is this book for? A brief overview of the principles behind Cloud-native applications.

Getting started

Chapter One

We'll start building our Rust toolkit: compilation, linting, security audit, formatting. We'll have a solid CI pipeline in place by the end of the chapter.

Our project

Chapter Two

We want to build an email newsletter API: what does it look like? We'll focus on working in iterations and introduce the concept of user stories.

Bootstrapping the application

Chapter Three

We'll boostrap an actix-web application from scratch, build a POST endpoint to enroll new subscribers, interface with a database to store their details with sqlx - all done with a test-driven development approach.

Telemetry

Chapter Four

An in-depth exploration of what it means to build an observable API as well as the tools to properly instrument our code (log and tracing crate).

Continuous Deployment

Chapter Five

A thorough introduction to Docker, including all the best practices for packaging Rust projects. We will then build a deployment pipeline to ship the application to DigitalOcean on every commit!

Domain Modelling With Types

Chapter Six

Rust is fast, but performance are only half of the picture: its type system is powerful enough to enable advanced design patterns. The chapter explores how to encode invariants using Rust types.

Writing A REST Client

Chapter Seven

We need to send a confirmation email to our new subscribers: we'll learn how to write a REST API client using reqwest and how to test it using HTTP mocking via wiremock.

Coming soon

Table of Contents

You can see the full list of planned chapters in the book sample. A new chapter is published every two/three weeks.

author image

About the author

My name is Luca Palmieri and I’m a Lead Engineer at TrueLayer.
I am a co-organiser of the Rust London User Group, an OpenSource contributor and a public speaker.

I have been developing in Rust for almost three years, previously in my free time, now professionally on a daily basis.

I have been fairly active in the OpenSource community.
I am the author of a few crates - ndarray-stats, wiremock, linfa and cargo-chef.
I also wrote some test-driven workshops to get people started with Rust - build-your-own-jira-with-rust and ndarray-koans.

I have been speaking regularly at meetups and conferences. You can find the recordings of my past talks here.

You can follow me on Twitter, on GitHub or on my blog.

Frequently Asked Questions

Can I read the book even if I don't know Rust?

Zero To Production is not an introduction to Rust, but it does its best to explain the main language constructs and concepts along the way.

If you have previous experience in another modern programming language and you keep the Rust book close you should not have any issue following along.
If you are not sure, check out the book sample before buying!

Do I need previous experience in backend development?

Not at all!

Zero To Production is designed as introduction to backend development: we do spend a significant amount of time talking about specific libraries and tools (we are doing it for real, after all!), but the underlying concepts and the rationale behind our choices are thoroughly explained, without assuming that the reader has worked on similar problems before. Check the book sample for a taste!

I like to say that Zero To Production shows you how the pros do it: we talk at length about observability, ease of operation, system design issues - topics that are often skipped or merely mentioned in "hands-on" backend books.

Can I have a look at the code before buying?

Sure thing - the whole API project that we build throughout the book is publicly available on GitHub.

If I buy early access, do I get the new chapters as they are released?

Yes!

Every time a new chapter of Zero To Production is released you will receive an email to notify you that new content is available.
You can also download the newest version of the book at any point in time from Gumroad - even a year from now, if a new edition comes out!

What if I buy it and then I hate it?

No biggie - send an email to contact @ lpalmieri.com and I'll give you a refund.

The book looks cool, but it's way too expensive for me!

If you are a student, unemployed or you just can't afford it right now send an email to contact @ lpalmieri.com - we'll sort it out!

If I find an error or a typo, how do I report it?

Send an email to contact @ lpalmieri.com - I am extremely grateful to all readers reporting issues!

What if I want to buy a copy of the book for my whole team?

On Gumroad's checkout page you can find both a team (up to 8) and a company (>8) license!