Sub topic 1
What Active-Active Means and How It Differs from Active-Passive
Prerequisites
This chapter assumes basic cloud networking and DNS concepts, familiarity with stateless web services and load balancers, and basic database knowledge. You should also understand availability and latency as service goals.
Active-Active and Active-Passive
An active-active design runs the service in multiple regions at the same time. Each region receives live traffic and can process requests. Data must be replicated or partitioned across regions.
An active-passive design sends traffic to one primary region. A secondary region waits for a failure before serving users. Active-passive is simpler, but failover takes time and the standby region may have less tested capacity.
Active-active can reduce latency and improve availability. It also introduces harder problems: conflicting writes, replication delay, routing errors, and higher operating cost.
Setting Goals
Define targets before choosing the architecture:
- Availability is the percentage of time the service works. A target such as 99.99% allows about 52 minutes of unavailability per year.
- RTO (recovery time objective) is the maximum acceptable time to restore service.
- RPO (recovery point objective) is the maximum acceptable amount of lost data, measured in time.
- Latency is the time needed to receive a response.
Active-active is justified when the required RTO, RPO, or user latency cannot be met by one region or a simpler standby design.
Consistency Trade-offs
During a network partition, CAP describes a choice between consistency and availability. A consistent system returns the same current value everywhere. An available system continues responding, even if some regions have stale data.
PACELC adds that, even without a partition, you often choose between lower latency and stronger consistency. Synchronous replication improves consistency but adds cross-region delay. Asynchronous replication lowers latency but permits stale reads and data loss after failure.
Choose a model per operation. Strong consistency fits payments and unique-name creation. Eventual consistency often fits feeds, metrics, and product views.
> Note: Active-active does not automatically mean every region can safely write every record.
Routing and Failover
DNS routing is simple but depends on caching and TTL values. Anycast advertises one network address from multiple locations and can provide fast network-level routing. A global load balancer can route using latency, geography, weights, and application health.
Health checks must test meaningful dependencies, not only whether a process responds. Automatic failover should remove an unhealthy region, but operators need safeguards against false failures and split brain, where multiple regions incorrectly believe they own traffic.
Exercise
When is active-passive usually preferable to active-active?
Show answer
Choose active-passive when the simpler data model, lower cost, and easier operations meet the required RTO, RPO, availability, and latency targets.