Calling someone else's API — payments, email, SMS, CRMs, AI providers — without making their outage your outage. The shape of resilience in a distributed world.
← Back to Server Side| Capability | Common providers | Watch out for |
|---|---|---|
| Payments | Stripe, Adyen, Braintree, Square | PCI scope, idempotency, webhook signature verification, 3DS / SCA flows. |
| Email (transactional) | SendGrid, Postmark, AWS SES, Resend | SPF / DKIM / DMARC, bounce + complaint handling, deliverability reputation. |
| SMS & voice | Twilio, Vonage, MessageBird | Country regulations (10DLC, A2P), opt-out handling, cost surprises. |
| Push notifications | APNs, FCM, OneSignal | Token rotation, silent vs visible payloads, quiet hours. |
| Identity | Auth0, Okta, Cognito, Clerk, WorkOS | SSO contracts (SAML, OIDC), SCIM provisioning, vendor lock-in. |
| Search | Algolia, Elastic, Typesense, Meilisearch | Index drift vs source of truth, reindex storms. |
| AI / LLMs | Anthropic, OpenAI, Bedrock, Vertex | Streaming, token costs, rate limits, prompt injection from upstream data. |
| Analytics & CRM | Segment, HubSpot, Salesforce, Intercom | PII handling, GDPR deletion, eventual consistency. |
| Storage & CDN | S3, GCS, Cloudflare R2, Cloudinary | Signed URLs, lifecycle rules, egress costs. |
Most modern APIs (Stripe, Square, AWS) accept an Idempotency-Key header. Generate one per logical operation and persist it alongside the operation. Reusing the key lets you retry safely without double-side-effects.
Circuit breaker: after N consecutive failures, stop calling the dependency for a cool-off period. Fail fast with a fallback. Libraries: Resilience4j (JVM), Polly (.NET), opossum (Node).
Bulkhead: isolate resources per dependency (separate thread pools / semaphores) so one slow vendor can't starve every request thread.
Wrap each vendor in an internal interface — EmailSender, PaymentProcessor. Your domain code talks to the interface, not to SendGrid's SDK. When you switch from SendGrid to Postmark in a year, you change one file.
Any feature that fetches a user-supplied URL (image previews, OAuth callbacks, webhook test buttons) is an SSRF risk — the user can point it at your cloud metadata service or internal admin endpoints.
https only) and resolve DNS yourself; block private IP ranges (RFC 1918, link-local, IMDS).