I used to read articles on usesthis.com when I was fresh out of college, and some of them influenced the choices I made. I thought it was about time to write down what I use. Who knows, maybe it might help someone. Hardware I usually get a MacBook from my employer. At home, I have built my own desktop computer. I have a dual 4K monitor setup and a Microsoft Sculpt keyboard. I am very particular…
At work, we made a decision to go with a table per tenant approach and we have been running that setup for a couple of years now. I thought this would be the right time to share what we have learned and what works well. Why? The first question is why do you want to create a table per tenant? In our case, we allow users to define their own event attributes with their own types. There are 2 main…
In earlier posts, I covered how to move full PostgreSQL data between instances using GCP DMS, and how to move selected tables across instances. In this post, I’ll focus on moving data for a specific tenant from one instance to another. This typically comes up in multi-region setups (US, EU), where a tenant needs to relocate, for example from US to EU, due to regulatory requirements. The approach…
In this post, I will discuss the overlay bar chart . There is plenty of material on stacked and grouped bar charts, but relatively little written about overlay bar charts. This post attempts to address that gap. There are many ways to visualize a dataset. Some approaches are better suited than others depending on the nature of the data. The same applies to overlay bar charts. They work well when…
At work, we recently had to move a few tables from one PostgreSQL instance to another. In my previous post , I discussed how to use Google’s Database Migration Service ( DMS ) to migrate data from one instance to another. Unfortunately, that option was not available here, since DMS only allows the migration of an entire database, not specific tables within a database. We chose the native logical…
At work, we recently upgraded our multi-terabyte PostgreSQL database from version 13 to 16 in Google Cloud Platform (GCP). This post shares lessons learned during the process, focusing on our experience using Google’s Database Migration Service ( DMS ). DMS supports various migration types, but here I’ll specifically cover CloudSQL PostgreSQL to CloudSQL PostgreSQL. Notably, we successfully jumped…
I recently built a hybrid query engine at work. In this post, I discuss what we did, why we did it, and how we accomplished it. To keep things simple, I present a simplified version of the problem, making it easier to explain while focusing on the key aspects. The real-world scenario is more complex, but the fundamental issue remained the same. Our database model can be simply described as: Think…
In my previous post , I discussed how to identify the causes of high CPU usage. In this post, I’ll focus on addressing system bottlenecks. Our production workload runs on 16-core machines, yet the CPU usage has never exceeded 70% . In other words, the system effectively uses no more than 11 cores. I took some time to eliminate the usual suspects to ensure I wasn’t investigating the wrong issue. In…
I recently made some optimizations at work that saved more than 40% CPU at peak time. In this post, I go over the details about how I identified and fixed the bottleneck. Preparation The first step is to identify the bottleneck. There might or might not be a single big bottleneck in a system. Usually, it’s not straightforward to replicate the production workload on a staging or developer machine.…
I recently came across the website called sadservers . When I checked the site, there were 28 problems, each presenting a broken server. These issues could be caused by misconfiguration, a filled disk, or any other operational problem. Your task is to fix the server. I am sharing my solutions to some of the problems. This is a edited version of my interaction with the server. 1. “Saint John”: what…