A Real-World Guide to Building Production-Ready Services
Wietse Venema

#Cloud
#serverless
#web_applications
#Knative
#Redis
Learn how to build a serverless real-world application in the cloud that's reliable, secure, and scalable. If you have experience building web applications on traditional infrastructure, this comprehensive and approachable guide shows you how to get started with serverless containers on Cloud Run.
Throughout the course of the book, you'll deploy and explore several example applications that highlight different parts of the serverless stack on Google Cloud. Combining practical examples with fundamentals, this book will appeal to both developers who are early in their learning journey and experienced practitioners.
You'll learn about:
If you build, maintain or deploy web applications, this book is for you. You might go by the title of a software engineer, a developer, system administrator, solution architect, or a cloud engineer. I carefully balance hands-on demonstrations with deep dives into the fundamentals so that you’ll get value out of it whether you’re an aspiring, junior, or experienced developer.
Building Serverless Applications with Google Cloud Run
Chapter 1 gives a general overview of what a serverless application is, introduces you to Google Cloud and their serverless products without going too much in depth. If you are new to Google Cloud, this will be a great introduction.
Chapter 2 is a hands-on introduction to Cloud Run. I’ll show you how to get started with Google Cloud and deploy your first Cloud Run service. While the first part of the chapter focuses on using Cloud Run, in the second part I explain the runtime characteristics of Cloud Run and how they influence the way you build your application. I’ll also compare Cloud Run with the other serverless runtimes on Google Cloud: App Engine and Cloud Functions.
In Chapter 3 you’ll find a thorough introduction to application development with containers. In this chapter I show you how to run containers on your local machine with Docker, create your own container images (with and withoutDocker), and dive into the fundamentals of containers.
The containers on Cloud Run are disposable. This requires you to store data you need to persist beyond the lifetime of a single request in a database or another downstream system. In Chapter 4 I dive into the managed product Cloud SQL (managed relational databases such as MySQL and PostgreSQL), in Chapter 5 I follow up with MemoryStore (Redis). I discuss scalability and reliability, as Cloud Run can scale to 1,000 containers very fast.
Especially if you are building a more serious application, you’ll want to make sure that every Cloud Run service in your system only has the permissions to do exactly what it needs to do. In information security, this is also known as the principle of least privilege: it helps to reduce the impact of a vulnerability in one part of the system. This is why I introduce you to Cloud Identity and Access Management (IAM) in Chapter 6.
Most applications have the need to schedule tasks to be executed later, either immediately after handling an HTTP request or at a scheduled time. In Chapter 7 I introduce you to Cloud Tasks when I cover patterns to use for task scheduling.
In Chapter 8 I’ll show you how to work with Terraform, an infrastructure as code (IaC) tool. Terraform lets you recreate your entire project using one command, which proves useful if your application grows beyond “Hello World”. If you are still getting started with building applications, you might want to skip this chapter and the last two chapters for now, to come back to them later.
I want to make sure that you have proper visibility over what is going on in your system when you go live for end users. This is why I cover structured logging and tracing in Chapter 9. Doing this right is fundamentally important when you run a system in production.
Finally, I move beyond the day-to-day concerns and think about the future in Chapter 10. If you build your application on top of a vendor-controlled platform, you should consider portability.
I've been fortunate enough to be a part of the Google team that helped create Knative and bring Cloud Run to market. I've watched Cloud Run mature as a product over the years. I've onboarded thousands of customers and I wrote a framework to help Go developers build Cloud Run applications faster--and even I learned a thing or two from this book. What took me three years to learn, Wietse delivers in less than a dozen chapters. Kelsey Hightower - Principal Engineer at Google Cloud
Wietse Venema's book goes into significant technical depth while also keeping the reader grounded with realistic scenarios. I had the opportunity to review it, and look forward to purchasing a copy of my own so that I can read it again. Google Cloud Run may be the most interesting compute platform you'll use in the years ahead, and this book will help you build up the knowledge you need to successfully use it.
Richard Seroter, Director of Outbound Product Management at Google Cloud
What can I say... this guy definitely knows what he's talking about. He is as enthusiastic about the subject as most people are about little puppies, and manages to explain it in a way that anyone can understand it.
His diagrams are a strong part of the book. They help you understand topics that can be daunting and difficult to comprehend, especially for junior backend developers like myself. Go buy this book, it will make your life running in the cloud a whole lot easier!
Femke Buijs - Software Engineer at Mollie
This is the most comprehensive, yet approachable guide to getting started with Cloud Run (and its vast array of accompanying tools and technologies) that currently exists - no small feat for a technology that's seen rapid evolution over the past 12 months. From introducing the concept of containers, to discussing the real-world considerations when deploying Cloud Run as part of a microservices-based architecture, Wietse has written a book that will appeal to both newcomers to Google Cloud and veteran developers alike.
Chris Tippett - Principal Consultant at Servian (UK)
Developers looking to future proof their career for the next decade will love this book because: #1 It is a practical, easy to read and concise guide on Cloud Run (the technology that finally closes the gap between Serverless and Containers). #2 The author covers a broad set of managed services on Google Cloud Platform to help you become productive quickly (even if you're new to GCP). #3 If you're skeptical about vendor lock-in, you will appreciate the section on how to take your serverless containers and "move out" of the Google Cloud.
Daniel Zivkovic, Solution Architect and Organizer of Serverless Toronto User Group
Wietse Venema is a software engineer. If he's not training teams to build scalable and reliable software, he's figuring out how things work so he can be a better engineer and teacher. He works at Instruqt as an engineer to change how people learn new technology.
He's proud to be the name twin (not family) of the famous Wietse Venema, who created Postfix.









