As I’m writing this, we’re in the middle of an AI-induced mass psychosis. People are literally token-maxxing themselves into hospital beds , scrambling to capture some of that market value before everything is automated away. I can’t blame them. Models keep getting better, programmers are being laid off left and right. We’ve been repeatedly told that AI will write 100% of…
The Kamal setup guides I found online focus on S3 backups using pg_dump . You don’t want that for a production database. A better solution is to set up your Postgres database for Point-In-Time Recovery (PITR) using WAL-G or pgBackRest. This means your database is continuously archiving WAL segments to an S3 bucket (roughly every 60 seconds), so you can restore to any point in time. With…
In October, I decided to try to switch my main development machine to Linux. After almost two decades in the Apple ecosystem, the change has been both refreshing and challenging. For over three months I gave it a serious try. I can’t say it was a success, though. In this post Background and motivation Hardware and distro Making it easier to switch The good parts Personal OS AI is good at…
The main Rails app I currently work on has just turned eight. It’s not a huge app. It doesn’t deal with web-scale traffic or large volumes of data. Only six people working on it now. But eight years of pushing new code adds up. This is a quick overview of some of the strategies we use to keep the codebase maintainable. In this post Background Modular Monolith Pub/Sub (Events) Patterns Service…
Base64 is one of those things I’ve used countless times, without ever fully understanding what it does. For my UUID shortener , I chose to implement Base32 — a more readable and URL-friendly alternative to Base64. I didn’t want to rely on any third-party libraries for the encoding part. This meant going back to basics and learning what actually happens when you encode data to a Base2ⁿ…
Recently, I wrote about UUIDv7 and how to use it in Rails. The time-sorted UUIDv7 addresses some performance issues associated with UUIDv4-based primary keys, but the experience of using UUIDs is still far from perfect: https://example.com/posts/226d037c-3b35-40f3-a30b-0ebb78779d9b The default string representation of a UUID is unnecessarily long (36 characters) and awkward to copy with a double…
Using UUIDs for primary keys offers many benefits, but there are some downsides to consider. The most widely-used UUIDv4 is fully random, which is ideal for minimizing the risk of collision. However, random IDs as primary keys do not index and sort efficiently, leading to index bloat and performance issues. There is a new standard that addresses this problem by including a UNIX timestamp 1 in the…
Update: March, 2024 The project described in this post no longer exists. However, some parts of it now live under a new project, available on GitHub . Many of the details below no longer apply, but I’ve decided to keep this post as a historical record. Over the course of the last few months, I’ve ported ImgKit, my image processing service, from Ruby to Go. This was my first project in…
This is what my photos looked like after I moved them to NAS With 50MB RAWs, hard drives fill up in no time. In the last five years I collected enough important photos to start thinking about a reliable storage solution that works well with Lightroom. I opted for Synology DS218 with two Seagate IronWolf drives.
The app I’m currently working on runs on Docker. It’s a medium-sized Rails monolith with a bunch of resource-heavy dependencies (Postgres, PostGIS, ElasticSearch, Redis, Next.js and a few more). Docker helps us make sure the whole stack works for everyone, every time. For those using Linux, it works without noticeable downsides. But on macOS, despite every possible performance tweak, Docker had…
Three years ago, I launched the first version of PixelPeeper and it was brutally minimalistic: I made a little website that takes a JPG image and shows you how it was edited in Lightroom (+ camera settings) https://t.co/EFG3UhMdTS pic.twitter.com/P8EaienbZ2 — Piotr Ch (@p_ch) June 19, 2017 In the following years I added new features, fixed bugs, but the way it worked and looked hasn’t…