Active-passive: chỉ một region nhận traffic; region kia là dự phòng, được promote khi failover. Đơn giản nhưng tài nguyên dự phòng nằm không, RTO phụ thuộc thời gian failover.
Active-active: mọi region cùng phục vụ traffic đồng thời (route user tới region gần nhất qua GeoDNS/Anycast). Lợi: latency thấp toàn cầu, mất một region thì các region còn lại gánh tiếp (RTO ≈ 0).
Thách thức cốt lõi — replicate dữ liệu ghi giữa các region:
- Write conflict: hai region cùng sửa một bản ghi. Cách giải: phân vùng theo region (mỗi user "thuộc" một home region), hoặc CRDT/last-write-wins, hoặc DB hỗ trợ multi-master (Spanner, DynamoDB Global Tables).
- Replication lag: ghi ở region A chưa thấy ngay ở region B → chỉ đạt eventual consistency xuyên region (CAP buộc chọn). Strong consistency xuyên region tốn round-trip rất đắt.
- Split-brain khi network partition giữa các region.
Hình dung: hai chi nhánh ngân hàng độc lập cùng ghi sổ; phải có cơ chế khớp sổ để không cộng nhầm số dư.
Lưu ý: thường lai — dữ liệu cần strong consistency (số dư) gắn home region; dữ liệu đọc nhiều/ghi ít (catalog, profile) replicate active-active thoải mái.
Active-passive: only one region serves traffic; the other is standby, promoted on failover. Simple but standby capacity sits idle and RTO depends on failover time.
Active-active: all regions serve traffic simultaneously (route users to the nearest region via GeoDNS/Anycast). Benefits: low global latency; losing one region lets the rest absorb load (RTO ≈ 0).
Core challenge — replicating writes across regions:
- Write conflicts: two regions edit the same record. Fixes: partition by region (each user has a home region), CRDT/last-write-wins, or multi-master DBs (Spanner, DynamoDB Global Tables).
- Replication lag: a write in region A isn't instantly visible in B → only eventual consistency across regions (CAP forces the choice). Cross-region strong consistency costs expensive round-trips.
- Split-brain on a network partition between regions.
Picture: two independent bank branches both writing the ledger; you need a reconciliation mechanism so the balance isn't miscounted.
Note: usually hybrid — strongly-consistent data (balances) is pinned to a home region; read-heavy/write-light data (catalog, profiles) replicates active-active freely.