Book Review: Building Serverless Applications with Google Cloud Run
My journey with Google cloud Run
Google Cloud Run is one of the few services of Google Cloud that I find myself cheating
on AWS. This is the most politically correct way to describe my journey with Cloud Run. It's
been almost a year now that I have started using Google Cloud Run as my de-facto deployment solution for the majority of
my toy projects, usually low volume public APIs, slack bots and all the things that more or less feature a web server
and spit out data. I have been extremely happy with its simplicity, good level of documentation, and the fact that is an
evolving service from Google that keeps getting better. If you are like me where you have lots of code packaged in a
docker container, and you want to just spin out in the wild services but still maintain some level of quality, like
HTTPS endpoints, auto scaling Google Cloud Run is a sweet spot! I have been lucky enough to work on projects that
adopted
kubernetes at scale very early and through this journey I never pivoted into the KNative Dream (this
abstraction on top of Kubernetes that aims to provide a more developer friend set of services for developers to ship
code). Despite the fact that Google Cloud Run is a proprietary implementation (internally) it maintains compatibility
with Knative techniques and APIs. So in my eyes, Google Cloud Run is very powerful Knative compatible implementation
that someone else maintains and upgrades for you while it just works!
The book
When I started my experiments with Cloud Run the main sources of documentation and learning were the official
documentation found here and the excellent unofficial FAQ by Ahmet.B. I was definitely not a green
user in terms of the basic concepts, that
really helped me to quickly grasp the basics of the CLI, the IAM roles involved, the specifics of the Google Container
registry and come up with a fairly easy CI pipelines to start deploying my code.
See here.
While this worked for me I guess there are a lot of developers out there that either did not have previous exposure to Kubernetes specific platforms or have not even heard the ideas and techniques of KNative. Things get slightly more complicated if you don't have big exposure with cloud platforms like AWS or Google cloud. At the end of the day all these things are nice to know, but you need to be able to get your job done and learn and master the things you need to master in order to deploy your code. This is where the book comes, and I think it serves this purpose. It provides a very good all around introduction not only to Google Cloud Run but overall on the ecosystem but it does not get lost in the details.
So if you are fairly new to Google Cloud, totally new to Kubernetes but you still want to deploy your dockerized the book is going to take you step by step and explain everything you need to know and understand about the platform.
Specific chapters
There were some chapters specifically that caught my eye and made me actually want to write this review and recommend the book.
Chapter 1 , 2 are all about explaining on how ClLoud Run works, specifics on how the platform will autoscale for you, how it implements request concurrency and how your container is going to be invoked per request.
Cloud Run is a very easy to use dev friendly service, but the devil is always in the details. You are given a lot of
power with a couple of clicks (or a script) and you need to understand how this will affect your bill, or the
performance of your deployed service. The author does a great job deep diving on the concurrency model, and the
available options for users that might need almost
infinite
horizontal scalability.
I also found Chapter 6 very useful, a very simple and quick introduction on the Identity and Authentication mechanism of Google Cloud (the equivalent of AWS IAM). It is one of the areas that most probably newcomers might struggle a bit especially if you want to do a slightly more complex example and connect your service another google managed service e.g. a Database or a Cache. I wish there were similar material for AWS IAM targeting the newcomers and not intimidating them!
Chapter 9 is all about logging, a very important aspect of the overall solution. There are some nice tips around HTTP tracing, and how you can correlate logs and track your request as it flows through the different layers of the Cloud Run glue code. The Logging and traceability offering is one of my least favorite aspects of Google Cloud in general, but it is highly integrated on the Google Run proposition, so you can not easily escape it.
Chapter 10 was also very interesting and useful. Cloud Run has a special relationship with KNative and to be honest it was an aspect I had not studied a lot in the past. I was in general sceptic towards KNative solutions on top of Kubernetes. I have a better understanding now and who knows maybe I will re-evaluate.
Overall
Overall, I think it's a solid book, and it super useful especially to people that have no experience on similar
solutions or cloud offerings. Cloud Run is a really nice service, and I think it deserves more in terms of adoption. The
book complements nicely the existing documentation and in many cases it explains things that could have been mentioned
on reference documentation.
So there is definitely added value. As I have already elaborated I had already extensive experience with the Kubernetes ecosystem, and the basic features of Cloud Run were very easy to grasp. The book helped me to re-evaluate some details around the KNative ecosystem and maybe pick a couple of tips that I had missed while experiment on my personal projects.
Worth your time and money :)
You can find it here