High Availability (HA)

infrastructure

High Availability (HA)

Definition

High Availability (HA) is the design and operational property of a system to remain operational and accessible to its users for a guaranteed minimum proportion of time, typically expressed as a percentage of uptime over a measurement period (e.g., 99.9% = "three nines" allows ~8.76h downtime per year; 99.99% = "four nines" allows ~52.6 min/year; 99.999% = "five nines" allows ~5.26 min/year). HA is achieved through a combination of architectural patterns: redundancy of critical components, automatic failover, load distribution, geographic dispersion, and operational practices including health monitoring, blue-green deployments, and rehearsed incident response.

Manažerské shrnutí

Pro Prismatic Platform je HA explicitní inženýrský požadavek vyjádřený v SLO platformy: webové dashboardy 99.9% (umbrella prismatic_web), API 99.95% (port 4004 prismatic_api), kritické DD case management funkce 99.99%. Manažersky podstatné: každá vyšší úroveň "devítek" znamená exponenciální nárůst nákladů (redundance HW, geografická distribuce, dedikovaný operační tým, testovaný DR plán) — five nines je u většiny aplikací zbytečně drahé. Realistický kompromis Prismatic: 99.95% pro core API, 99.9% pro UI, 99.5% pro analytické dávkové úlohy. HA neřeší logické chyby (bug v kódu se replikuje do všech instancí), ani škodlivé útoky (kompromitovaný účet má přístup ke všem replikám) — proto HA musí být doplněna o disaster recovery, immutable audit log, a sandbox staging.

Operational Context

HA je vícevrstvý problém:

  • Hardware/infrastructure layer: redundantní napájení, RAID disky, multi-AZ deployment, BGP-routed IP failover.
  • Network layer: redundant uplinks, anycast DNS, CDN distribution, DDoS mitigation.
  • Application layer: stateless services s load balancerem, sticky-session-free design, database connection pooling s reconnect logic.
  • Data layer: replikace (synchronní pro primary failover, asynchronní pro DR), automated backups, point-in-time recovery, consistency tuning (CAP teorém — výběr CP nebo AP podle business potřeby).
  • Operational layer: monitoring (Prometheus, Grafana), alerting (PagerDuty, on-call rotation), runbooks, chaos engineering (záměrné injekce selhání pro testování HA).

Klíčové metriky: MTBF (Mean Time Between Failures), MTTR (Mean Time To Repair), RTO (Recovery Time Objective), RPO (Recovery Point Objective).

Practical Application

  1. Phoenix LiveView under HA: bezstavové LiveView procesy distribuované přes BEAM cluster s connection-state v PubSub, failure jednoho uzlu způsobí transparent reconnect klienta na zbylé.
  2. PostgreSQL HA: streaming replication s Patroni orchestrátorem, etcd quorum store, pgBouncer connection pooling. Failover detection ~5s, promote ~10-15s.
  3. Meilisearch read-replica fan-out: write-only primary + N read replicas za load balancerem; čtecí dotazy škálují horizontálně.
  4. Disaster recovery drill: kvartálně se rotuje primárního DC do sekundárního, měří se reálná RTO a RPO, výsledky se zařazují do compliance reportu.

References

  • Brewer, E. CAP Twelve Years Later: How the Rules Have Changed (Computer, 2012)
  • Beyer, B. et al. (Google SRE) Site Reliability Engineering (O'Reilly, 2016)
  • Bernstein, P. A. & Newcomer, E. Principles of Transaction Processing (2nd ed., Morgan Kaufmann, 2009)
  • Birman, K. P. Reliable Distributed Systems (Springer, 2005)

Built with precision. Optimized for AI consumption.