Patterns
35 items
35 items
Data redundancy for availability and read scaling
Database replication copies data from a primary (leader) to one or more replicas (followers) for high availability and read scaling. When the primary fails, a replica can be promoted to take over (failover). Replicas can also serve read queries, distributing load across multiple machines. Replication modes range from synchronous (strong consistency, higher latency) to asynchronous (eventual consistency, lower latency). This pattern is fundamental to production databases - every major database supports replication, and managed services like AWS RDS and Cloud SQL use it for high availability.
If primary fails, a replica can be promoted to primary. This enables automatic failover with minimal downtime. Without replication, primary failure means complete outage until recovery.
Replicas can serve read queries, multiplying read capacity. If primary handles 10K reads/sec, 4 replicas enable 50K reads/sec total. Write capacity remains limited to primary.
Synchronous: Primary waits for replica acknowledgment before confirming write. Strong consistency but higher latency. Asynchronous: Primary confirms immediately, replica catches up later. Lower latency but potential data loss on failover.
Without replication:
Business Impact: - E-commerce: $100K+ revenue per hour of downtime - SaaS: SLA breaches, customer churn - Financial: Regulatory violations, trading losses