👋 Hello!

I am a Software Engineer at GitHub and I have a passion for distributed systems, which I apply to the world of DevOps tooling and cloud infrastructure. I like to contribute to open source Go- and Rust-based projects in this space when time allows and I used to be into getting Google Cloud certifications and giving trainings and talks about it. I'm currently learning more about lower-level concepts and systems programming, like container runtimes and networking.

The rest of my time is spent cycling, cooking on a kamado, stargazing, playing piano or videogames, and cleaning litterboxes 🐈.

Check out my LinkedIn and GitHub profiles for more info.

An introduction to Golang concurrency primitives

Concurrency is a powerful feature of the Go programming language that allows developers to write efficient and scalable programs. Go makes it easy to write concurrent programs by providing several high-level abstractions, such as goroutines, channels, the select statement, mutexes, and wait groups. Goroutines are lightweight threads of execution that can be easily created and managed by the Go runtime. Goroutines are similar to threads in other languages, but they are much cheaper to create and manage, which makes them ideal for concurrent programming....

6 December 2022 · 4 min · Luca Cavallin

What is Google Cloud Deploy?

Teams are moving to the cloud to modernize their infrastructures, along with adopting DevOps practices to deliver faster, reliable, and quality software. They are making efforts to increase their deployment frequency, decrease the lead time for changes, lower change failure rate, and reduce the time to restore services after a failure. One of the effective ways to achieve the above four metrics is to have an effective and robust continuous delivery pipeline....

9 December 2021 · 3 min · Luca Cavallin

What is GitOps?

DevOps practices such as CI/CD, version control, and collaboration have helped teams delivering higher quality software faster. Thanks to DevOps culture, development teams are able to deploy code into production several times per day, automating most of the processes. There is, however, still a need for teams to manually perform infrastructural activities, such as maintaining, managing, and provisioning the infrastructure: this takes a lot of time and effort! Automation is the key to relieve teams of such burden and that’s what GitOps is for....

2 December 2021 · 4 min · Luca Cavallin

How to Read Firestore Events with Cloud Functions and Golang

So you want to know “How to Read Firestore Events with Cloud Functions and Golang” ? You’re in the right place! I recently worked on a side project called “Syn” (https://github.com/lucavallin/syn - Old Norse for vision!) which aims at visually monitoring the environment using the Raspberry Pi, Google Cloud and React Native. The Raspberry Pi uses a tool called motion, which takes pictures (with the Pi camera) when movement is detected....

27 July 2021 · 5 min · Luca Cavallin

A comparison of Google Cloud Pub/Sub and NATS

Introduction This article presents a comparison of Cloud Pub/Sub and NATS as message brokers for the distributed applications. We are going to focus on the differences, advantages and disadvantages of both systems. Cloud Pub/Sub Cloud Pub/Sub provides messaging and ingestion features for event-driven systems and streaming analytics. The highlights of the tool can be summarized as follows: Scalable, in-order message delivery with pull and push modes Auto-scaling and auto-provisioning with support from zero to hundreds of GB/second Independent quota and billing for publishers and subscribers Global message routing to simplify multi-region systems Furthermore, Cloud Pub/Sub provides the following benefits over non-Google-managed systems:...

26 July 2021 · 8 min · Luca Cavallin

How to Deploy a Multi-cluster Service Mesh on GKE with Anthos

Anthos Service Mesh is a suite of tools that helps you monitor and manage a reliable service mesh on-premises or on Google Cloud. I recently tested it as an alternative to an unmanaged Istio installation and I was surprised at how much easier Anthos makes it to deploy a service mesh on Kubernetes clusters. In this article, I am going to explain step-by-step how I deployed a multi-cluster, multi-region service mesh using Anthos Service Mesh....

23 July 2021 · 6 min · Luca Cavallin

How to safely store secrets in Terraform using Cloud KMS

I have recently worked on a project where I needed to configure a Helm release with secrets hard-coded in Terraform. With Cloud KMS, I could encrypt the secrets so that they could safely be committed to git. In this article, I am going to show you how the process works. Setup Cloud KMS Since my project is already up and running, all I had to do was to create a Cloud KMS keyring and crypto key that will be used for encrypting and decrypting secrets....

4 July 2021 · 3 min · Luca Cavallin

How to use Terraform workspaces to manage environment-based configuration

I have recently worked on a 100%-Terraform based project where I made extensive use of Workspaces and modules to easily manage the infrastructure for different environments on Google Cloud. This blog post explains the structure I have found to work best for the purpose. What are Terraform workspaces? Workspaces are separate instances of state data that can be used from the same working directory. You can use workspaces to manage multiple non-overlapping groups of resources with the same configuration....

11 June 2021 · 3 min · Luca Cavallin

How to Deploy ElasticSearch on GKE using Terraform and Helm

I was recently tasked with deploying ElasticSearch on GKE using Terraform and Helm, and doing so in most readable way possible. I wasn’t very familiar with Helm before, so I did some research to find approach that would fulfill the requirements. In this post I will share with you the Terraform configuration I used to achieve a successful deployment. What is Helm? Helm is, at its most basic, a templating engine to help you define, install, and upgrade applications running on Kubernetes....

2 May 2021 · 3 min · Luca Cavallin

How to optimize PHP performance on Google Cloud Run

I recently had to optimize the performance of a PHP-based API on Cloud Run. After a performance test, we discovered that the API became very slow when we put some serious load on it (with response times exceeding 10 seconds). In this post you’ll learn what changes I made to get that down to a stable 100ms. The API uses PHP 7.4, Laravel 8.0 and MySQL on Cloud SQL (the managed database on Google Cloud)....

4 March 2021 · 5 min · Luca Cavallin