Tech Stacks to Achieve High Availability 00:00:01 Build a complete path before copying parts A shopper connects directly to one application process. That process can run perfectly for a year and still be the only door that needs to close for every checkout to stop. Which layers require independent recovery? Users reach one pod directly. Nothing has a spare. A load balancer that spans zones and three pods behind it. One pod may die. The browser first looks up the name and gets the balancer's address. DNS health checks can point it to another region. A primary with a standby in another zone. This layer holds the data, so a leader must be chosen safely. Redis with a replica takes reads off the database. It may be empty after a failure. Separately consider entry, application execution, durable state and the cache. Two copies sharing the same failure boundary may disappear together when an entire availability zone is lost. 00:00:59 Choose the routing boundary A layer-four balancer can forward a connection using the network address and transport port. It does not need to interpret an HTTP path to make that routing decision. The next connection goes to the other server. All requests inside one connection stay together. The balancer ends TLS and reads the path: /api/orders goes to the API service. /web/home goes to the web service, over the same client connection. A transport-level balancer and an application-aware gateway can make different routing decisions. Adding both should solve a concrete need for this traffic rather than simply lengthening the checkout path. 00:01:40 A database chooses a new primary PostgreSQL copies data; Patroni and etcd decide who is the primary. A renews its 30-second lease every 10 seconds and sends its log to B. The lease is no longer renewed. Writes fail from now on. After at most about 30 seconds etcd drops the lease. B checks that it was not too far behind. B takes the lease, becomes primary, and HAProxy's check now finds B. The old primary must be safely rejoined as a standby. Depending on prerequisites and divergence, the operator may rewind it or rebuild it; its unsupported local history must not override the elected primary. Promotion requires coordinated authority and safe handling of the old primary. Asynchronous replication can leave acknowledged changes behind, so quote the recovery-point target as well as the time to accept new writes. 00:02:36 Spread application replicas The same three replicas, packed on one node or spread over three. Without rules the scheduler may place all three pods on one node. All three are gone. New pods start elsewhere, but only after the cluster decides that the node is lost, which takes minutes by default. With a spread rule every node has one pod. Two pods keep answering while a third is recreated. Scheduling replicas on different hosts or zones can protect them from a shared failure. Verify actual placement and that surviving hosts have enough capacity to start or serve the remaining work. 00:03:15 Lose one of three zones Three zones, one power failure, and the question of room. Every zone carries a third of the traffic, and half of what it could. Its pods vanish. The balancer stops sending there and the other two take over: 50% x 3 divided by 2 equals 75%. 70% x 3 divided by 2 equals 105%. More than there is: the two remaining zones would fail as well. If three equal zones run at seventy percent and one disappears, transferring all demand would require a hundred five percent from each survivor. Redundancy without headroom can turn one lost zone into three overloaded zones. 00:04:00 Rebuild the cache without flooding storage Why the cache is part of the availability story. Redis answers 95% of reads. The database is calm. Redis is back within seconds, but empty. All reads go to the database, 20 times more than before. A replica that is promoted keeps most keys, and each missing key is loaded once and not by every request. Promoting a replica may preserve many warm keys, but missing data still requires a refill strategy. Coalesce popular misses and watch the origin while ordinary traffic is returning. A redundant stack is a set of tested failure paths. Walk one purchase through a failed zone, a promoted database and a cold cache before treating the architecture as highly available.