As I’m learning Go programming language while also working with building and maintaining distributed systems, this book seemed like a clear choice. Here are some thoughts after I’ve read it!
TL;DR is that I give this book 4 / 5⭐. Read more to find out why.
You can find my repository with the code and additional notes here.
Review
I have to start with a confession that I haven’t read a lot of programming books, so I might not be able offer proper feedback. This review is based purely on what value it brought to me and how I felt while and after reading the book.
Strength of a book like this is that it introduces a concept and explains how it will be used in a Go application that is being built through the book. That also allows a reader to do a deeper dive of the introduced concept later on their own.
The book has four sections, so that’s how I’ll organize my review.
Part I — Get Started
The book began very promising. I built a proof-of-concept app and run a few curl commands to interact with it. It work and the feeling was great.
Then there was the introduction of protocol buffers and how I can describe the core api for the application.
In the third chapter of this section the author gave a clear explanation of what are we exactly building - a Log (together with a concept of a Segment and an Index). Since this is a backbone of many different distributed systems I was really glad I got some hands-on experience with it.
At this point I was really looking forward to extending this to be distributed and with all the bells and whistles.
Part II — Network
Here is where gRPC, Security using certificates and Observability are introduced. All three of these are programming language agnostic, so that makes this a very relevant section regardless of if you are programming in Go or not.
Here the author described how you can define a service
in protobuf, generate Go code, and implement a full gRPC server. Another interesting thing described here was how to do error handling with gRPC.
It is always interesting to see how are authentication and authorization handled, and in this section I was introduced to CFSSL and Casbin. CFSLL is a tool that helps us generate certificates which are then used for authentication, and together with Casbin’s ACL (Access Control List) feature, for authorization.
Final chapter of this section is dedicated to Observability and its three pillars: Metrics, Structured Logs and Traces.
Part III — Distribute
If you are actually building a distributed application, concepts introduced in this section are essential. Here it is explained how does Service Discovery work using Serf, what is Consensus and how to implement it using Raft and finally how to implement Client-side Load Balancing using gRPC.
This was also the hardest section to follow. Mentioned concepts are complex enough, and here I was writing some code based on the promise that it works. I had an application I never ran, and now I was making it so that I could have more instances of it… Fun stuff! 🚀
Part IV — Deploy
In this section I was suppose to run Kubernetes using Kind and install the application using Helm Charts. The author gave a really good introduction to this whole ecosystem.
This is where things started to fall apart a bit due to our ever-changing field. What may have worked when the book was written, with the current state of things it was not possible to get the results described in the book. Lucky I was not the only one, so after a few google searches I found parts of the solution.
I understand that this section was necessary, otherwise it would be hard to prove how concepts introduced in previous chapters work in reality. But in the end I felt a bit disappointed. The only way I interacted with the application I was building was either through tests or my imagination. There was no final chapter where I actually got to use the app and do the same thing I did in the beginning - make some curl calls and see the app work. I also never saw mentioned metrics, structured logs and traces in action. If there is ever a second edition of this book, that is the final chapter I would like to see.
Conclusion
I would definitely recommend this book. Are there better resources to learn Go? Sure. Better resources to learn about Observability? Of course. Better resources to learn about Kubernetes? Definitely. But as a whole this book guides you through the entire process of building an actual, and very important, component of many distributed systems. Something that would otherwise take much much more time of research and struggling to figure out. I’m really glad that I have this on my very slowly growing read bookshelf and will happily come back to it in the future for some inspiration.