Disponibilidad y Redundancia
Nueves · Failover
Escrito por Darjus Kazakevic · revisado el
Each extra nine costs far more than the last, so set the target first.
Availability is usually written in nines. 99.9% allows 43 minutes of downtime a month; 99.99% allows 4. Each extra nine needs a different design. Roughly, two instances behind a load balancer reach 99.9%, several zones 99.99%, and several regions 99.999%. Each step costs several times more than the last.
Redundancy only helps when switching to the spare works. That needs health checks that test the real dependencies, and a failover you rehearse. Set the target per user journey, not per system: checkout may need 99.99%, while recommendations are fine at 99%.
En esencia — Availability is the share of time the system answers correctly: set it as an SLO, buy it with redundancy, and spend the error budget on purpose.
Cuándo recurrir a él
Recurre a él cuando
- Downtime has a price you can state in revenue or broken promises
- Some journeys, like checkout, need more nines than the rest
- You sign an SLA with customers and must be able to keep it
Reconsidéralo cuando
- Internal or batch tools where an hour of downtime costs little
- Before an SLO exists — redundancy without a target has no end
- The real risk is bad deploys, not hardware — fix releases first
Conceptos clave
- The nines
- Availability as a percentage of time, usually over 30 days. Each extra nine divides the allowed downtime by ten.
- SLI, SLO and SLA
- An SLI (service level indicator) is what you measure, such as the share of requests that succeed in under 300 ms. An SLO (objective) is your target for it. An SLA (agreement) is the contract, with money attached.
- Error budget
- The downtime the SLO allows: 43 minutes a month at 99.9%. While budget remains, ship features. When it is spent, slow down releases and fix reliability first.
- Failure domains
- A spare copy only helps if it does not fail together with the original. Put copies in separate failure domains: another machine, another availability zone, another region.
- Series and parallel (Availability maths)
- Dependencies in a chain multiply: two 99.9% services in series give 99.8%. Redundant copies multiply the failure: two independent 99% copies give 99.99%.
Reglas de diseño
- Write the SLO before adding redundancy
- Each extra nine costs several times the last. Set the target per user journey, such as checkout at 99.99% and recommendations at 99%, and stop adding redundancy when you reach it.
- Remove single points of failure
- List every component a request needs: load balancer, app, database, DNS, secrets. Any one with a single copy caps your availability at its own.
- Rehearse the failover
- Redundancy only counts if switching to it works, and an untested failover is a second outage. Fail over on purpose on a schedule, such as promoting the database standby once a quarter.
- Page on error-budget burn, not on every error
- Page when errors would spend 2% of the month's budget within an hour, a burn rate of 14.4. Single errors are noise; a fast burn is an incident.
Errores habituales
- A health check that only proves the process is alive. The load balancer keeps sending traffic to an instance whose own connection pool is broken.
- Redundant copies that share one dependency, such as the same zone, DNS provider or config service. They fail together.
- Measuring availability on the server. Users also see DNS, CDN and network failures that the server's own metrics never record.
- Promising 99.99% on top of a dependency that offers 99.9%. In a chain, you cannot be more available than a critical dependency.