What disaster recovery and failover architectures ensure high availability for mission-critical enterprise integrations?
Answer
Basics: Salesforce operates multi-site infrastructure and has its own disaster recovery (site switching, status at trust.salesforce.com). Your responsibility is the integration layer, the external systems, and your data recovery design. The question is what happens when either side is down.
How it works:
- Redundant middleware: active-active or active-passive instances behind a load balancer or DNS failover; stateless so any node can handle any message.
- Durable buffering: queue messages (message broker, or Salesforce Platform Events within retention) so outages do not lose data.
- Retry with exponential backoff and a cap, plus idempotent receivers so retries are safe.
- Circuit breaker: stop calling a failing endpoint and queue or fail fast.
- Endpoint failover: in Salesforce use Named Credentials so the endpoint can be repointed in one place; keep a standby endpoint.
- Replay and reconcile: after recovery, replay events (72-hour window for platform events) or run delta syncs using
SystemModstamp.
Advanced / deep dive: Define RPO and RTO per integration; mission-critical order flows may need near-zero RPO (dual writes are risky; prefer events plus reconciliation). Salesforce outbound messages retry for up to 24 hours; Apex callouts do not retry on their own, so build retry via Queueable/Scheduled jobs. Because Salesforce IP ranges and instance addresses can change (and Hyperforce changes hosting), integrate by My Domain and Named Credentials and avoid hard-coding instance URLs. Keep backups: Salesforce Backup and Restore (paid) or exports/third-party tools, since the recycle bin holds deleted records for only 15 days. Test failover regularly with game days, and monitor with synthetic transactions.
Code / config example:
Failover pattern (declarative + middleware):
Named Credential "ERP_Primary" -> https://erp-a.example.com
On repeated 5xx/timeouts (circuit open after N failures):
update endpoint to "ERP_Secondary" (deploy Named Credential change or use a gateway DNS name)
Failed messages -> Integration_Log__c (Status = Retrying) -> scheduled Queueable retries with backoff
Hidden gotchas & must-remember points:
- Salesforce does not give you control of its failover; design for tolerance.
- Platform event replay window is limited (72 hours); long outages need delta sync.
- Never hard-code instance URLs or IPs.
- Retries without idempotency create duplicates.
- Backups are separate from the recycle bin (15 days).
- A single middleware node is a single point of failure.
Best practice: Stateless redundant middleware, durable queues, idempotent retries, and a rehearsed recovery plan with defined RPO and RTO.