Availability and Reliability
A service can respond and still behave incorrectly
Availability and reliability are often mentioned together, but they are not the same thing. A system can be available — accepting requests and returning responses — while still producing incorrect data. And the opposite can happen: the system may preserve data correctly but be temporarily unavailable to the user.
Availability: can the system be used right now?
Availability shows what fraction of time a system is ready to serve requests. If a service works almost all the time and recovers quickly from rare failures, its availability will be high.
availability = uptime / total time
Availability is affected by more than complete application crashes. If a service is technically running but every request times out, from the user's perspective it is effectively unavailable as well.
Reliability: can the result be trusted?
Reliability describes a system's ability to perform its work correctly and consistently over time. For different products, “correctly” means different things: not losing a payment, not delivering the same event twice, preserving an uploaded file, or returning the correct order state.
Reliability becomes especially visible not during normal operation, but when problems occur: a process restart, temporary network loss, a dependent service failure, or hardware malfunction.
Failures should be treated as a normal part of the system
The more components there are, the greater the chance that one of them will misbehave at a particular moment. That is why it is useful to design a distributed system not with the thought “servers do not fail,” but with the thought “individual failures are inevitable — what happens after one occurs?”
Client → Service A → Service B → Database
X
Service B unavailable
The architecture must define what to do in such a situation: can the operation be retried, should a temporary error be returned, can a standby instance be used, or can the system continue in a degraded mode? The exact mechanisms depend on the system requirements.
An availability number always has context
The phrase “99.9% availability” is incomplete by itself. You need to understand the period over which it is calculated, what counts as a successful request, which components are included in the measurement, and what the end user actually experiences.