High availability (HA) means keeping the database available even when failures occur — through replication (standby replicas), automatic failover (promoting a replica when the primary fails), and proper architecture. The goal: minimize downtime and data loss, since database outages take down the whole application.
The foundation: replication + automatic failover
Primary ──(streaming replication)──▶ Standby replica(s)
If the PRIMARY fails:
→ a STANDBY is automatically PROMOTED to become the new primary (FAILOVER)
→ the application reconnects to the new primary → minimal downtime
→ Without HA, a primary failure = total database outage = application down.
