Single Gateway vs Multi Gateway Architecture
Single gateway: simpler, lower maintenance, appropriate for most businesses under NGN 100M/month with a single primary market. Multi-gateway: add a second when you need failover (primary gateway outage affects revenue), market coverage (second gateway covers a country the first does not), or routing optimization (direct bank integrations for high volume). Do not add a second gateway because it "seems safer" — the operational complexity is real and the benefit only materializes if the first gateway fails, which should be rare.
Single vs Multi-Gateway Trade-offs
| Dimension | Single Gateway | Multi-Gateway |
|---|---|---|
| Integration complexity | One set of APIs, one webhook handler, one set of credentials | N times the complexity; requires abstraction layer |
| Reconciliation | One settlement report, one transaction log to reconcile | Multiple reports, cross-gateway reference mapping required |
| Failover | If gateway is down, payments fail | Route to secondary on primary outage — requires health monitoring |
| Country coverage | Limited to primary gateway's markets | Route by country to the best gateway for each |
| Stored cards/subscriptions | Token lives on one gateway | Tokens are not portable — each gateway stores its own |
| Maintenance burden | One gateway to update when APIs change | All gateways need updates when any changes |
| When to use | Starting out, single market, under NGN 100M/month | Scale, multi-market, or demonstrated failover need |
// Multi-gateway routing example with health checking
class PaymentRouter {
constructor(gateways) {
this.gateways = gateways; // [{ name: 'paystack', client, healthy: true }, ...]
}
async route(country, amount, channel) {
// Filter to gateways that support this country + channel
var eligible = this.gateways.filter(g =>
g.healthy && g.countries.includes(country) && g.channels.includes(channel)
);
if (!eligible.length) throw new Error('No healthy gateway available for ' + country + '/' + channel);
// Simple round-robin or primary-first selection
return eligible[0];
}
async healthCheck() {
for (var g of this.gateways) {
try {
var res = await fetch(g.healthUrl, { timeout: 3000 });
g.healthy = res.ok;
} catch {
g.healthy = false;
}
}
}
}
Learn More
See building a payment provider abstraction layer before adding a second gateway.
Key Takeaways
- ✓Start single-gateway. Add a second only when you have a specific, demonstrated need.
- ✓Multi-gateway adds complexity: two webhook handlers, two reconciliation flows, two sets of credentials to rotate.
- ✓Build a payment provider abstraction layer before adding a second gateway — retrofitting is painful.
- ✓Failover requires health checking and automatic routing — not just "we have two accounts".
- ✓Subscription tokens and stored card authorizations are gateway-specific — multi-gateway does not help with these.
Frequently Asked Questions
- Does Paystack have its own failover?
- Paystack has internal redundancy and processes payments across multiple acquiring banks. A Paystack outage is rare because of this internal architecture. That said, if Paystack's infrastructure has a widespread issue, all transactions routed through Paystack fail regardless of internal redundancy. The question is: how often does that happen, and what is the revenue impact when it does? For most businesses, a Paystack outage a few times per year is an acceptable risk compared to the complexity of maintaining a second integration.
- Should I build multi-gateway from the start to "future-proof" my architecture?
- No — this is premature optimization. Build a thin abstraction layer (an interface your payment code uses instead of calling Paystack directly), but only implement the Paystack adapter behind it. When you need a second gateway, add the second adapter. Building two full integrations from day one means double the surface area for bugs, double the maintenance, and two credential sets to manage — before you have any evidence you need the second gateway.
- What is the best way to handle active subscriptions when adding a second gateway?
- You cannot migrate Paystack subscription tokens to another gateway — they are gateway-specific. The practical approach: keep existing subscriptions on Paystack, route new subscriptions to whichever gateway based on your routing logic. Over time, as old subscriptions cancel and re-enroll, they will naturally migrate to the preferred gateway. Do not try to force-migrate active subscriptions.
Ready to build real-world apps?
Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.
Apply to the McTaba Marathon