Failover and shared state
Separate routing state from application state
A successful proxy failover can still break a shopping cart if the session lived only in a lost application process. Keep application state in a durable or appropriately replicated service; session affinity may improve locality but does not restore lost data. An Nginx upstream zone shares information between local workers, not machines. Plus zone synchronization is a separate, limited facility for supported runtime data such as certain rate-limit, key-value and sticky-learn records. It is not a general database, cache-file replication or a guarantee of strong consistency. F5 advises against stretching such clusters across regions or availability zones. Verify synchronization lag and feature-specific support.
Proxy worker state -> local shared memory zoneApplication session -> application-owned storeCached public object -> local cache, rebuildableSupported Plus zone data -> separate synchronization designDesign a safe endpoint transition
A VIP or external load balancer determines where traffic enters. A network partition can leave both nodes believing the other is dead. In a system needing one active owner, split-brain means competing owners may act simultaneously. Use a reviewed external coordination and fencing mechanism (preventing a former owner from acting) appropriate to the platform; avoid a homemade two-node ping election. Existing TCP sessions generally are not transferred by moving a VIP. A DNS change also does not terminate existing sessions, and recursive resolvers and clients may retain prior answers. TTL is a cache lifetime hint, not a guaranteed global failover deadline.
Observed loss of heartbeat != proof of peer shutdownSafe transition: confirm authoritative ownership -> fence old owner -> activate standby -> verifyDNS record change -> resolver caches converge at different timesKeep configuration and certificates consistent
Distribute one reviewed versioned configuration artifact to all proxies, while retaining node-specific listener and path settings where necessary. Validate each candidate with the appropriate binary and check the active endpoint after reload. Store certificate and private key material in an approved protected secret-distribution system, not Git or a shared public directory. Validate names, expiry, trust chains and permissions on every serving node. F5 describes configuration synchronization separately from runtime zone synchronization; configuration write and reload privileges are highly sensitive. Prefer controlled deployment with narrowly scoped access and an audit trail.
proxy A: config r17, cert for shop.test, valid -> eligibleproxy B: config r16, cert for old.test -> hold out of rotationDeploy reviewed r17 + correct certificate to B; validate before enabling trafficPlan what happens to caches and sessions
Two independent proxy_cache directories are not automatically coherent. A node returning after downtime may have a cold cache or old objects; use versioned assets and reviewed cache policies, and plan for a temporary rise in origin traffic. Do not mount an arbitrary shared directory and assume Nginx cache metadata is coordinated between hosts. A session cookie may point to a lost application replica; the durable session store and authentication policy determine whether the user can resume. Test a read, a login/session check and a write with an application-level idempotency strategy separately. Avoid promising that interrupted writes will be replayed safely.
Fail proxy A -> route to BB has cold cache -> origin receives additional public GETsSession store available -> existing valid session can be recovered by appWrite outcome unknown -> reconcile using application transaction/idempotency recordApply what you learned
Practice: A standby has the wrong certificate name, stale configuration and a cold cache. The primary heartbeat is missing. Describe what must happen before accepting traffic and how to handle an interrupted write. Work from the stated assumptions; the manual exercise and quiz are staged separately. Related references and next lesson are listed in the chapter authored map.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Failover and shared state
Assess high-availability and recovery reasoning.
Where should authoritative cart state survive a proxy or application restart?
What does moving a VIP not guarantee?
During a partition, both nodes believe they own a single-active endpoint. What is needed?
Node B has an outdated certificate for another name. What should happen?
After switching to a cold cache, what should operators anticipate?