Works On My Machine(tm)
Oh, but it works on my machine! Today, I found myself staring at the monitor, adding logs and reviewing existing ones, carefully stepping through code to rule out mistakes. The frustration was real. It’s these kinds of head-scratchers that remind us why debugging is both an art and a science.
The Unseen CulpritPicture this: an orchestrator service working flawlessly in the local environment, but crashing consistently in production. After hours of investigation, I found the culprit: an unhandled ...
Mocking HttpClient the simple way
Ever found yourself deep in unit tests, only to realize you need to mock an HttpClient? Yep, we’ve all been there. There are many ways of doing it, but which way is the best? Let me show you a straightforward yet flexible way to mock HttpClient. It’s simple, effective, and it’s going to make your life a whole lot easier.
So, let’s begin with implementing two helpers, which will be useful in setting up our mocks.
First, we create a custom HttpMessageHandler to intercept and handle HTTP requests i ...
'Production Ready' Non-Negotiable: Comprehensive Testing
Early in my career, I joined a team that had extensive test coverage—hundreds of unit and functional tests with reasonable mocks. Management was proud of it. The metrics looked great. But when I started digging into the actual tests, I found something shocking: most of them didn’t have assertions. They were testing that code ran, not that code worked correctly.
The codebase was in free fall for other reasons (years of accumulating debt), but the tests created a false sense of security. Everythin ...
'Production Ready' Non-Negotiable: Memory Dump Tooling
You’ll never need memory dumps. Until you do. And then it’s the only tool that saves you.
In our microservice architecture, we have gRPC services talking to each other via gRPC streams. During acceptance testing, QA reported that certain features would hang indefinitely. No error messages. No exceptions. No stack traces in the logs. The system just… stopped responding.
The backend team started doing what everyone does: trial and error. Disable feature A, test again. Disable feature B. Toggle thi ...
'Production Ready' Non-Negotiable: Performance Metrics
At RavenDB, I debugged a customer’s query that was taking several seconds to complete. The server-side processing was fast. But end-to-end, from the client’s perspective, the query was slow. Users were waiting.
The culprit wasn’t where you’d expect. It wasn’t the query engine or the storage layer. It was the network payload.
The Investigation: What Performance Metrics RevealI pulled the performance metrics first. The query itself was fast—executed efficiently, returned results quickly. Everythin ...
'Production Ready' Non-Negotiable: Structured Logging and Monitoring
At RavenDB, I spent nights debugging failures where logs and monitoring seemed to contradict each other. One said “disk queue is dangerously high.” The other said “1,000 backups just started simultaneously.” Here’s what I learned: they were both right, and together they told the whole story. Separately, they would have buried me for hours.
Let me show you what happened, because this is why structured logging and monitoring aren’t optional—they’re how you survive production.
The Story: 1,000 Simu ...
Production-Ready Software: Introduction
For over a decade, I’ve worked on systems where production failures aren’t theoretical—where you debug crashes at 2am, optimize under real load, and understand exactly how things break at scale. I spent seven years on the core team at Hibernating Rhinos working on RavenDB’s core systems—the Voron B-Tree storage engine, server components, and direct customer production support. Then I spent 6+ years applying and refining those lessons across different companies and scales.
This series is what tha ...
Taming Complexity with Responsibility
Imagine, one quiet morning, your boss comes to you and says, “Hey, our web shop is growing and we will be having more than one delivery provider now. Can you implement something that would select the best provider after a client pays for a delivery?”.After some back and forth about the criteria on how a delivery company should be selected - mostly by package size, weight and delivery company area, you set out to write the code. How hard can it be? Just write a few if statements, and that’s it, r ...
From Inheritance Hell to Component Heaven, the ECS Pattern
All you need is love and Object-Oriented, right? Right?Object-Oriented programming is one of the most widely used programming paradigms. It’s flexible, powerful, and has proven its worth over the years. However, as with any tool, there are situations where it might not be the best fit. In some cases, using an Object-Oriented approach can result in code that’s hard to maintain and overly complex.
Let’s say we’re developing a game and we want to add magic weapons. It should be trivial to create a ...
Disentangling the Spaghetti Monster
In this blog post, we will explore the practical application of a specific design pattern. To illustrate its usefulness, we will gradually reveal the problem in an “organic” manner, simulating how one might encounter such an issue in their daily programming tasks.
The What and WhyPicture this: you’re working on a music streaming platform, and you already implemented live and offline playback, search functionality, and user ratings. The last piece of the puzzle? Playlist suggestions based on user ...









