UPI Switch Active-Active Multi-Region Architecture: Achieving 100,000 TPS & Sub-20ms P99 Latency
How Indian fintech payment switches architect dual-region active-active clusters across Mumbai and Hyderabad — achieving sub-20ms P99 latency, zero-RPO database consensus on distributed SQL, dynamic traffic shifting, and seamless DR failovers.
1. The Limits of Active-Passive Disaster Recovery in UPI
In traditional banking architecture, institutions rely on an Active-Passive disaster recovery (DR) setup: Region A handles 100% of the live load while Region B sits idle in warm standby. During sudden datacenter blackouts or fiber cuts, spinning up the secondary site takes between 15 to 45 minutes — resulting in millions of dropped payments and regulatory fines from NPCI.
Processing 100,000 transactions per second (TPS) during festival surges requires a true Active-Active Multi-Region deployment where both Mumbai (DC) and Hyderabad (DR) concurrently process financial transactions with zero data loss (RPO = 0) and instantaneous failover (RTO < 1s).
2. Dual-Region Topology & Consensus Mechanics
As visualized in our hand-drawn technical whiteboard blueprint above, an active-active switch consists of four synchronized architectural tiers:
- Anycast BGP & Cloudflare Geo-Routing: Routes incoming mobile payment payloads to the topologically closest datacenter with sub-5ms network transit.
- Stateless Rust/Go Switch Microservices: High-concurrency switch workers process XML/JSON ISO 8583 message parsing without persisting session state in local memory.
- Distributed SQL Cluster (Raft/Paxos Consensus): Spans across Mumbai, Hyderabad, and an independent witness zone (Bangalore) to guarantee transactional consistency without two-phase commit locks.
- Redis Enterprise Multi-Master Replication: Synchronizes idempotency keys, merchant rate limits, and risk velocity counters in < 8ms across regions.
3. Handling Cross-Region Write Conflicts
Because payment balances cannot tolerate split-brain states, the switch implements account-based sharding and single-writer leaseholders:
// Sharded transaction lock pattern with leaseholder pinning
async function executeActiveActiveUPI(txnPayload) {
const payerHash = hashVpa(txnPayload.payerVpa);
const preferredRegion = (payerHash % 2 === 0) ? 'MUMBAI_ZONE' : 'HYDERABAD_ZONE';
// Verify local Redis idempotency key with cross-region replication
const isDuplicate = await redisCluster.set(`IDEMP_${txnPayload.clientTxnId}`, 'PROCESSING', {
NX: true,
EX: 45
});
if (!isDuplicate) throw new DuplicateTransactionError("Transaction already in flight");
// Route ledger update to local Raft consensus group
const ledgerResult = await distributedSql.transaction(async (tx) => {
return await tx.executeLedgerHold(txnPayload);
});
return ledgerResult;
}
4. Zero-Downtime DR Drills: Chaos Engineering
NPCI mandates regular unannounced DR switchover drills. An active-active switch achieves continuous verification by conducting "Blackhole Simulations":
- Synthetic Traffic Bleed: Progressively shift 10% to 100% of Mumbai traffic to Hyderabad within 30 seconds using weighted DNS SRV records.
- Automated Circuit Breakers: If cross-region inter-DC latency exceeds 35ms, the system decouples analytics telemetry and falls back to local async sync queues.
- Bank Simulator Health Probes: Synthetic health pings constantly test issuer bank CBS adapters to detect bank downtime before real user transactions fail.
5. Architecture Metrics: Active-Passive vs. Active-Active
| Capability | Legacy Active-Passive DR | Active-Active Multi-Region |
|---|---|---|
| Recovery Time Objective (RTO) | 15 – 45 minutes | < 1 second (Zero drop) |
| Recovery Point Objective (RPO) | 5 – 30 seconds (Data lost in transit) | 0 (Strict Serializable Raft) |
| P99 System Latency | 85 – 140ms | < 18ms |
| Hardware Utilization | 50% (Standby capacity wasted) | 100% (Both DCs actively process load) |
1. एक्टिव-पैसिव डीआर की सीमाएं और एक्टिव-एक्टिव की आवश्यकता
पारंपरिक बैंकिंग प्रणालियों में एक डेटासेंटर चालू रहता है और दूसरा बैकअप के रूप में निष्क्रिय रहता है। किसी बड़ी खराबी के समय बैकअप शुरू करने में 15 से 45 मिनट लग जाते हैं, जिससे करोड़ों रुपये के यूपीआई लेनदेन अटक जाते हैं।
त्योहारों पर प्रति सेकंड 1,00,000 से अधिक भुगतानों को संभालने के लिए एक्टिव-एक्टिव मल्टी-रीजन आर्किटेक्चर अनिवार्य है, जिसमें मुंबई और हैदराबाद दोनों डेटासेंटर एक साथ बिना किसी रुकावट के लेनदेन प्रोसेस करते हैं।
2. रीयल-टाइम डेटा सिंक्रोनाइजेशन और शून्य डेटा नुकसान
जैसा कि ऊपर दिए गए हैंड-ड्रॉन आर्किटेक्चर आरेख में दर्शाया गया है:
- एनीकास्ट जियो-राउटिंग: उपयोगकर्ता का भुगतान निकटतम डेटासेंटर में 5 मिलीसेकंड में पहुंचता है।
- डिस्ट्रीब्यूटेड एसक्यूएल कंसेंसस: राफ्ट (Raft) प्रोटोकॉल के जरिए डेटा दोनों रीजन में एक साथ सुरक्षित होता है।
- शून्य डाउनटाइम: एक डेटासेंटर बंद होने पर भी दूसरा केंद्र 1 सेकंड के भीतर पूरा ट्रैफिक संभाल लेता है।