When your production server goes down, every second of downtime costs revenue. Without automatic failover, recovery can take hours while someone manually intervenes. We configure automatic failover so that traffic switches to a standby server within 30–120 seconds, slashing RTO from hours to seconds. For a typical e-commerce site earning $10,000/hour, reducing RTO from 15 minutes to 45 seconds saves over $2,200 per outage. With over 7 years of experience in fault-tolerant architectures and 40+ failover projects, our engineers hold AWS and Linux certifications and deliver stable, battle-tested solutions.
How automatic failover works
Failover can be implemented at different stack levels: DNS, load balancer, virtual IP (VRRP), and database. Each has trade-offs in switchover speed, complexity, and cost.
DNS-level is the simplest but slowest. A health check polls the primary every 10–30 seconds. On failure, the DNS record is updated to point to the standby server. The total delay comprises the record TTL plus detection time: 60–300 seconds. Suitable for most web applications where a 5-minute pause is acceptable.
Load Balancer (e.g., AWS ALB/NLB, nginx upstream) switches in 5–30 seconds but requires both servers in the same cloud or region. Health checks operate at the balancer level.
VRRP / Keepalived uses a virtual IP that moves between servers when the master fails, achieving 2–5 second switchover. Classic for on-premise and dedicated setups. Keepalived is 5 times faster than DNS failover.
Database failover is a separate challenge. The application must know the new primary DB. Solutions like Patroni (PostgreSQL), MHA (MySQL), or AWS RDS Multi-AZ handle this automatically.
DNS vs Load Balancer: Comparison
| Parameter | DNS failover | Load Balancer |
|---|---|---|
| Switchover time | 60–300 s | 5–30 s |
| Setup complexity | Low | Medium |
| Cloud dependency | No | Yes (often) |
| Best for | Most web applications | High-traffic systems |
DNS failover is 10× slower than a load balancer but simpler and provider-agnostic.
Example: AWS Route 53 configuration
Route 53 Failover Policy: Primary record → 1.2.3.4 (main server) Health check: HTTP GET /health, port 443 Failure threshold: 3 consecutive failures Request interval: 10 seconds Secondary record → 5.6.7.8 (standby server) Evaluate target health: Yes The /health endpoint must verify real readiness: database accessible, cache working, disk space sufficient. It should return 200 only when fully operational. Our engineers customize this check to your stack.
Keepalived for bare metal and VPS
# /etc/keepalived/keepalived.conf on PRIMARY vrrp_script check_app { script "/usr/local/bin/check_app.sh" interval 5 weight -20 fall 2 rise 2 } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 virtual_ipaddress { 192.168.1.100/24 } track_script { check_app } } The check_app.sh script verifies application liveness locally. After two consecutive failures, the BACKUP server (priority 90) takes over the virtual IP.
Why failover testing is critical
Regular drills are mandatory. An untested failover will likely fail when you need it. Our standard verification protocol:
- Confirm monitoring records the initial state.
- Simulate failure:
systemctl stop nginxoriptables -I INPUT -p tcp --dport 80 -j DROPon primary. - Record time until switchover.
- Verify service via the standby server.
- Restore primary, test automatic fallback.
Target metrics: detection time < 30 s, switch time < 60 s, total RTO < 120 s. Automatic failover is 20 times faster than manual recovery.
Example full test scenario
For a comprehensive test, simulate simultaneous network, database, and application failures. Measure the time until full service recovery.
Case study: High-traffic e-commerce failover
A client with a peak-time load of 5000 requests per second experienced 15-minute downtimes when their single server failed. We implemented a two-tier failover: Keepalived for virtual IP switching and Patroni for PostgreSQL database failover. The result: automatic recovery in under 45 seconds, even during Black Friday traffic spikes. Revenue loss from unplanned downtime dropped by over 85%, saving approximately $2,000 per outage.
What's included in our turnkey failover setup
- Analysis of current architecture and availability requirements
- Designing the failover scheme (DNS, load balancer, VRRP, DB)
- Configuring health checks and monitoring
- Implementing data synchronization (database replication, file sync, sessions)
- Developing automatic switchover scripts
- Testing failure and recovery scenarios
- Documentation and team training
- Optional post-deployment support
Our team: 7+ years of experience, 40+ implemented failover projects, and certified engineers (AWS, Linux).
Setup duration estimates
| Failover type | Estimated time |
|---|---|
| DNS (Route 53 / Cloudflare) | 1–2 days |
| Keepalived + synchronization | 3–5 days |
| Full scheme with DB failover (Patroni) | 5–10 days |
| Testing and documentation | 1–2 days |
Exact timeline depends on infrastructure complexity. Contact us for a free assessment.
The split-brain problem and its solution
Split-brain occurs when both servers claim to be primary. In Keepalived, it is solved by fencing (STONITH) — the weaker node is forcibly shut down upon conflict. In PostgreSQL/Patroni, an external DCS (etcd, Consul, ZooKeeper) acts as an arbiter. We guarantee your scheme prevents this scenario through split-brain prevention mechanisms.
Monitoring failover events
Every switchover is an incident that requires investigation. Alertmanager or PagerDuty capture the event. A ticket is automatically created in Jira/Linear. After remediation, a root cause analysis determines why the primary failed.
Contact us to discuss your project. Order failover configuration and ensure your service stays available.







