Zero to Production in Rust, by Luca Palmieri

Zero to Production in Rust, by Luca Palmieri
Credentials by: Luca Palmieri

TL;DR This is one of the best books on applied software programming I have ever read.

The Book in 3 Sentences

This is a very detailed and meticulous introduction to Rust. It discusses a wide range of topics. The book teaches the programming language and how to apply it in real life, building a real-world application from scratch.

Impressions

Well. I read all chapters and did all exercises. And this is an excellent book. It is a good example of how to write books on applied topics. If you want to learn a programming language deeply, you should take some paper or an official manual. But if you want to get into the topic and start building something quickly, this is what you need. This is how books should be written.

The book consists of 11 chapters. Every chapter uncovers one specific topic. It will not teach you elementary stuff like what a variable is - for that, you better take some other book. But this book will teach you how to build in Rust a real-world application: with an API, authorization, database connection, telemetry, logging, and proper error handling - everything that real-world applications need.

What I value even more is that every topic is started from the very beginning, from the fundamental implementation. And then, the author shows you why this implementation is weak and why it is not production-ready. And then, he discusses "with you" what options you have and how it might be implemented in Rust. Next, he suggests one of the options, explaining the reasoning behind the choice.

I have some experience with Haskell (I never worked with it professionally, though). And what Haskell (or Haskell community?) really needs is this kind of book!

How I discovered it

Not even sure. Perhaps, I met someone mentioning Zero to production in Rust on Twitter.

Who should read it?

If you are interested in Rust, you definitely should read this book. But you should have some experience with another programming language - the book doesn't teach the fundamental concepts.

If you are not interested in Rust specifically but are interested in computer programming (or you are a computer programmer), I still highly recommend the book.

How the book changed me

I have been programming since I was 11 (when I am writing this, I am 43). I never worked with Rust, but I got interested in the topic. I turned to a very positive impression of Rust as a tool. I did a couple of pet projects in Rust. I plan to use it in more extensive projects in the future.

Criticisms

Since for every chapter/topic, the author goes step by step from the fundamental implementation to the proper one, sometimes some tiny parts of code appear to be missed. I can't provide a good example here. But a couple of times, while working through the book, I found myself with a broken code from the examples. Nevertheless, it is a minor thing and not a deal breaker. The book is well written, and the author invested much effort in working on it.

Another thing is that when it comes to testing, you need a database so your application can connect to and run the tests. The author suggests using Docker for spawning a database instance. So, a new container spawns, a new DB with a random name is created, tests are run, the container stops, and the DB is removed. Easy. But here is a problem: it works (I believe so) like a charm under Linux, but it is not that simple when you do it under Mac OS. Since Docker is not a native tenant in the Apple world, I used PostgresApp for running PostgreSQL on my Macbook Pro. The problem was that whenever it created a new DB with a random name, the old DB didn't remove automatically. So, after a dozen tests, you have a dozen databases with random names. And then it is a pain to clean it all up. So I had to adapt the test scripts to my situation. Again, this is not a problem as a Problem.

Summary, Thoughts, Notes

This is a very good book. I wish we had more books like this on other languages/technologies.