Reliability Is Not the Absence of Failures
A production bug taught me that passing tests and healthy microservices don't guarantee reliable software. Here's why business-specific monitoring matters.
On this page
Some time ago, I was working on a social commerce app where we had a pretty serious production bug. Users started reporting that they had lost their rewards.
But here's the interesting part: nothing crashed. The microservices were running, health checks were green, and all our tests were passing.
So what went wrong?
One of our microservices was responsible for calculating user rewards, including resetting them at the beginning of each month under certain conditions. The problem was that we hadn't properly considered users' timezones. We stored timestamps in UTC (which is completely fine), but our business logic didn't always account for the user's local date.
As a result, some users lost rewards they shouldn't have lost.
Our tests didn't catch it because they only verified UTC-based scenarios.
I managed to fix the calculation, but the trickiest part was recovering the lost rewards. Fortunately, another microservice stored audit logs, so I wrote a backfill job that reconstructed the missing data using the existing rewards API.
After the incident, we added integration tests for different timezones and, more importantly, custom Grafana metrics to monitor the rewards functionality.
And that's exactly what I want to talk about: an application can look perfectly healthy while doing something completely wrong.
Your 100% test coverage doesn't mean much
One thing that still surprises me is how many developers believe that high test coverage means their application is reliable.
It doesn't.
You can have 100% test coverage and still have broken business logic. If your tests are based on incorrect assumptions, they'll simply confirm those assumptions.
And with AI-generated code and tests, I think this problem is becoming even more dangerous. AI can produce hundreds of tests, but what's the point if they're all verifying the wrong behavior?
I'm a big supporter of TDD and BDD, precisely because they help us focus on expected behavior rather than just implementation details. TDD isn't limited to unit tests, and BDD often involves acceptance tests describing real business scenarios. But neither approach can save us if we've misunderstood the requirements in the first place.
The same applies to health checks. Of course, they're essential, and I always add them to my services. But a successful health check doesn't mean your business logic works correctly. It doesn't even guarantee that your service isn't consuming excessive CPU or memory.
This is why I believe developers should pay much more attention to business-specific monitoring. Not just CPU usage, memory, and HTTP errors, but metrics that tell us whether important features are actually working as expected.
If we'd had proper rewards monitoring from the beginning, we might have discovered the problem before our users did.
Reliability depends on what matters to the business
While reading Martin Kleppmann's Designing Data-Intensive Applications, I particularly liked his distinction between faults and failures.
A component can fail without bringing down the entire application.
And that's exactly what happened in our case. The rewards feature was broken, but the app's core functionality — browsing, shopping, and payments — continued working.
Now imagine the same problem affecting payments. The consequences would have been completely different.
I've also worked with a client in the EV charging industry who was willing to shut down their entire infrastructure during a serious security incident. Even though every minute of downtime could mean lost revenue, protecting customer data and avoiding potentially greater financial damage was more important.
So, is an application that intentionally shuts down less reliable than one that stays online at any cost?
I don't think so.
Reliability isn't just uptime. It's about meeting the expectations that actually matter to the business and its users.
Of course, we need tests, health checks, monitoring, and proper error handling. But none of these tools alone makes an application reliable.
And perhaps the most important question we should ask isn't whether our services are running, but whether they're actually doing what they're supposed to do.
---
Inspired by Martin Kleppmann's Designing Data-Intensive Applications, particularly Chapters 1 and 8.
Additional reading: Martin Fowler — Test Coverage · Google SRE — Service Level Objectives
