Multi-ESP fallback routing configured
Why it matters
A single-ESP sending architecture creates a hard dependency on one provider's availability. When SendGrid, Mailgun, or Postmark experiences an outage, all outbound email stops until the provider recovers. For SaaS products where password resets and billing receipts are blocking user actions, even a one-hour outage translates directly to churn and support volume. ISO-25010:2011 reliability.availability requires that systems maintain service continuity through component failures — a second ESP is the minimal architectural hedge against that dependency.
Severity rationale
Info because multi-ESP fallback is a hardening concern; many teams acceptably accept the availability dependency of a single ESP with a good SLA.
Remediation
Implement a simple circuit-breaker router in lib/email/router.ts that switches to a fallback provider after a configurable failure threshold:
export class EmailRouter {
private failures = 0
private readonly threshold = 5
constructor(
private readonly primary: EmailProvider,
private readonly fallback: EmailProvider
) {}
async send(msg: EmailMessage) {
if (this.failures >= this.threshold) return this.fallback.send(msg)
try {
const result = await this.primary.send(msg)
this.failures = 0
return result
} catch (err) {
this.failures++
if (this.failures >= this.threshold) return this.fallback.send(msg)
throw err
}
}
}
Store the fallback ESP's credentials in separate environment variables and verify both during the startup health check.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Sending Pipeline & Infrastructure Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.availability — Availability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from sending-pipeline-infrastructure·automated