High Availability Architecture Patterns: From Single Data Center to Multi-Region Disaster Recovery
This article analyzes high availability construction for financial application systems, covering application cluster perspectives, business transaction analysis, infrastructure redundancy, and deployment architectures from single data center to multi-region disaster recovery, with specific RTO/RPO targets and technology choices like Nacos, Kafka, and distributed databases.
Reading font
Overall Goals of High Availability Construction
The core objective in financial systems is to minimize or eliminate unplanned downtime, ensuring core services remain continuously available during hardware/software failures, local disasters, or regional catastrophes. Key targets include:
Availability metrics : Annual downtime controlled at minute-level (99.99% ≈ 52 minutes/year, 99.999% ≈ 5 minutes/year).
Recovery Time Objective (RTO) : Seconds to minutes after failure.
Recovery Point Objective (RPO) : Near-zero data loss; core systems often require RPO=0.
Disaster resilience : Withstand single-point, data-center, site-level, and city-level failures.
Elastic scaling : Handle traffic spikes (e.g., flash sales) while maintaining stability.
Consistent user experience : Failover and disaster recovery should be imperceptible or minimally disruptive.
Business System Availability
2.1 Application Cluster Perspective
Narrowly, an application cluster is a group of instances providing the same business function, acting as a seamless service cluster via load balancing, cloud-based elastic scaling, and service registration/discovery for automatic failover. Broadly, an application cluster encompasses the entire upstream/downstream system chain for a critical business scenario — e.g., a mobile payment involves terminal, channel, and core transaction systems. The article illustrates a payment flow where a gateway interacts with Customer System, Cashier, and Payment Engine. Therefore, HA design must adopt the broad cluster view, establishing multi-active deployment across application, network, and infrastructure layers to minimize impact during single-site failures.
2.2 Business Scenario and Transaction Link Analysis
Visualize end-to-end transaction links : Map all involved systems, services, databases, and middleware. This visualization is the foundation for fault isolation and root-cause location.
Analyze strong vs. weak dependencies : Identify services whose unavailability causes core business failure (e.g., authorization, login). Strong dependencies demand high availability; weak dependencies (auxiliary functions) can be handled via async, isolation, or degradation.
Combining this analysis with application design yields strategies like redundancy, circuit breaking, rate limiting, degradation, and full-link monitoring to improve resilience and emergency response.
2.3 Basic Support Applications
Two categories: (1) Technical platforms for business systems — configuration centers (Nacos), message queues (Kafka), API gateways. (2) Operational platforms — monitoring, switching, network/cloud/database management platforms. For technical platforms, HA is considered at design time:
Nacos : Cluster deployment with client-side local config caching allows business apps to run during brief config-center outages.
Kafka : Broker clusters with multi-replica mechanism ensure message service continuity and no data loss during node failures, enabling reliable async tasks, event notification, and data sync for eventual consistency.
API Gateway : Cluster deployment with load balancing provides dynamic routing, load balancing, circuit breaking, rate limiting, auth, and monitoring.
However, operational platforms often lack HA due to resource constraints. During site-level failures, unavailable monitoring delays alerts, and unavailable switching platforms prevent execution of predefined emergency procedures, severely impacting recovery efficiency.
Application Layer High Availability Design
Leveraging base component capabilities to achieve robustness and eliminate single points:
Redundancy to eliminate single points : Every link (gateway, app service, key downstream interfaces, DB, MQ) must have redundancy via clustering or active-standby.
Rate Limiting : At system entry or critical service entry via gateways (Spring Cloud Gateway, Kong) using token bucket or leaky bucket algorithms to prevent overload from bursts or malicious requests.
Degradation : Proactively disable non-core functions, return fallback data (cache, defaults), or simplify flows when resources are tight or dependencies fail. Strategies include functional, dependency, and traffic degradation to protect core business.
Circuit Breaking : Adopt circuit breaker pattern (Hystrix, Sentinel). When error rate or latency exceeds threshold, breaker opens and subsequent calls fail fast, preventing resource exhaustion and cascade failures.
Async and Message Decoupling : Move non-real-time strong-consistency ops (notifications, logs, non-core state updates) to message queues, decoupling caller and callee, improving throughput and fault tolerance.
Timeout and Retry : Set reasonable timeouts for all external calls (DB, cache, service, API) to avoid thread blocking. Implement strategic retries with exponential backoff for retryable failures (network jitter).
Idempotency Design : Use tokens, unique serial numbers, DB unique indexes/optimistic locking to make core write interfaces (payment, deduction) idempotent — repeated calls with same parameters yield same result.
Full-Link Monitoring and Tracing : Integrate tracing (Trace), metrics (Metrics), and log aggregation (Logging). Monitor key indicators (success rate, latency, error codes, traffic) end-to-end with fine-grained alerts for rapid bottleneck and fault location.
Business Switches and Playbooks : Pre-configure dynamic switches via config center to quickly disable problematic modules or toggle degradation strategies, plus detailed emergency operation manuals.
These designs enable self-protection and fast recovery, preventing localized faults from cascading into system-wide avalanches.
Infrastructure Layer High Availability Construction
Infrastructure is the carrier; its HA architecture sets the ceiling for application disaster recovery. Goal: through redundancy, geographic dispersion, and intelligent scheduling, handle failures at device, rack, AZ, data-center, and city levels, achieving minimal RTO/RPO. Different application criticality dictates different infrastructure HA strategies. A table (referenced as image) shows RTO/RPO/availability requirements for financial applications of varying importance.
4.1 Single Data Center HA
Eliminate single points within one data center for device/rack-level HA.
Network redundancy : Dual-homed switches, firewalls, load balancers; dual physical paths for critical links.
Application deployment : Cluster across different servers/containers; virtualization layer uses anti-affinity to spread instances across hosts.
Storage redundancy : SAN/NAS with dual controllers, multipath, RAID; distributed storage with 3-replica mechanism, auto-recovery on node/disk failure.
Database redundancy : Leverage DB native HA (primary-standby or distributed cluster) with auto-failover; enforce anti-affinity at server layer so primary/standby reside on different hosts.
Suitable for less critical non-core systems or as local HA foundation for higher-level DR architectures.
4.2 Single Data Center Multi-AZ HA
Divide one DC into multiple physically isolated Availability Zones (AZs), each with independent power, cooling, network. Key apps and data deployed across AZs for AZ-level DR.
AZ delineation : Clear physical boundaries (different floors, power zones, network aggregation) so single events (leak, power cabinet failure) don't affect multiple AZs.
Network interconnect : High-speed low-latency (≤1ms) internal network with ample bandwidth.
Application deployment : Clusters span multiple AZs; load balancer distributes traffic across AZs.
Database deployment : Primary/standby or distributed nodes placed in different AZs.
Storage deployment : Distributed storage places replicas across AZs; centralized storage uses cross-AZ synchronous replication.
Handles AZ-level failures; traffic fails over to other AZs within seconds.
4.3同城应用双活 (Same-City Dual-Active)
Two independent data centers (DC1, DC2) in same city, both actively serving production read/write traffic (Active-Active), peers backing each other. Application layer achieves dual-active; database layer is harder.
High-speed low-latency interconnect : Bare fiber + DWDM or carrier dedicated lines, stable latency <2ms, bandwidth ≥10Gbps.
Global load balancing : DNS-based intelligent routing by domain, DC health, load; rapid traffic switch on site failure.
Application layer : Dual deployment, peers, DNS for traffic distribution/scheduling.
Database layer : Apps write to production DB primary; rely on DB data sync for cross-site consistency. On production DB anomaly or site failure, auto/manual switch to同城 site. Partial dual-active possible via application unitization. [2]
Achieves DC-level DR with 100% resource utilization, sub-second failover, meeting stringent financial core system requirements (core trading, core accounting).
4.4同城多可用域 (Same-City Multi-AZ)
Extension of single-center multi-AZ: treat same-city as a logical super-DC with multiple strictly isolated parks, each with independent power, cooling, network core.
Site-level isolation : Sufficient physical distance and infrastructure independence to withstand larger-scale failures (e.g., park-wide power outage).
Network interconnect : Bare fiber or high-reliability dedicated lines, latency <5ms.
Application deployment : Stateless instances across parks; DNS for traffic distribution.
Database deployment : Distributed DB nodes across parks using Raft/Paxos for cross-park consistency (RPO≈0).
Storage deployment : Replicas placed across parks.
Stronger DR than single-center multi-AZ. Prefers keeping user requests within one park to reduce cross-park calls, but retains cross-park DR capability. Ideal for native distributed databases like TiDB, OceanBase built on Raft/Paxos.
4.5异地灾备 (Remote Disaster Recovery)
Build DR center hundreds of kilometers away (latency tens of ms) for city-level catastrophes (earthquake, flood, massive outage, war). Production runs business; DR center syncs data but cannot guarantee RPO≈0; app deployment not fully symmetric — only key core systems deployed, used mainly for DR switch or drills.
Network interconnect : Carrier long-haul lines, high cost, latency >30ms, jitter.
Global traffic scheduling : DNS routes by domain, health, load; masks failed production site, routes to DR.
Application deployment : DR center mirrors production apps but usually non-symmetric, not carrying production traffic or only whitelisted business.
Data replication : DB async replication (primary to standby, RPO minutes to hours); storage async replication.
Meets regulatory DR requirements and drill plans; relatively high cost.
4.6异地多中心容灾 (Remote Multi-Center DR)
Multiple remote centers all carry production read/write traffic (typically regional — users access nearest).
Network interconnect : Same long-haul constraints (>30ms, jitter).
Global traffic scheduling : DNS intelligent routing; masks failed center, reroutes traffic.
Application deployment : Independent deployment per center serving local/adjacent users. Design follows unitization — user requests and data operations close-loop within one center to minimize cross-center calls.
Data replication : DB async replication via binlog. Application must handle conflict detection/resolution: last-write-wins by timestamp, business-rule merge, vector clocks for eventual consistency.
Example: Three-site six-center architecture — 3 cities, each with 2同城 dual-active DCs. Suits large financial institutions with extreme availability demands. Access layer routes by region (e.g., Beijing-Tianjin-Hebei, Yangtze Delta, Greater Bay Area). App layer multi-active with no single point. DB layer per-city primary-standby; business-layer data partitioning — some read/write in site A, others in site B. Maximizes business continuity, avoids global outage. [3]
4.7 Architecture Comparison
A table (referenced as image) compares HA architectures across RPO, RTO, and cost. For financial-grade critical applications, selection must combine business availability requirements, key scenario/link analysis, and cost-availability trade-offs to choose the appropriate architecture for extreme failure recovery.
References: 1. “万字长文,四句口诀搞懂支付交易”, 刚哥白话 2. 数据库同城双活方案, 牧羊人的方向 — https://mp.weixin.qq.com/s?__biz=MzI3MzUzMjIxNA==&mid=2247485907&idx=1&sn=2297b3e8e65c73f37bc297184273cd86&scene=21#wechat_redirect 3. 聊聊数据中心的灾备建设, 牧羊人的方向 — https://mp.weixin.qq.com/s?__biz=MzI3MzUzMjIxNA==&mid=2247485871&idx=1&sn=d64f94ee5ec65367ddb32b395cd018f3&scene=21#wechat_redirect
For questions about attribution, corrections or content rights, please contactand we will review it promptly.