Concept 1 of 8Patterns and APIs

The six integration patterns, with interview scenarios

Request-reply, fire-and-forget, batch data sync, remote call-in, UI update on data change and data virtualization: what each is, how it's built on Salesforce, and a scenario you can quote for each.

Your confidence:Not rated

Simple explanation

Salesforce's integration patterns describe who starts the conversation, whether the caller waits, and where the data lives. Every integration answer in an interview should name one.

PatternDirection and timingTypical Salesforce building blocksScenario to quote
Request and replySalesforce calls out and waits for the answerApex callout or External Services from Flow, Named Credentials; LWC β†’ Apex β†’ APIA rep clicks Check credit on an opportunity; ERP returns the credit limit in under 2 seconds
Fire and forgetSalesforce sends and doesn't wait for the business resultPlatform Event or Queueable callout, outbound message (legacy); middleware acknowledgesClosed-won opportunity β†’ order sent to ERP via middleware; status comes back later
Batch data synchronizationScheduled bulk movement, either directionBulk API 2.0 via ETL or middleware, Change Data Capture for deltasNightly sync of 2 million product prices and customer master records from ERP
Remote call-inAn external system calls Salesforce to create, update or readREST/SOAP/Composite API, Apex REST, an External Client App with OAuthA web shop creates a case in Salesforce when a customer reports a damaged parcel
UI update based on data changesSalesforce UI refreshes automatically when data changesPlatform Events or Change Data Capture + lightning/empApi in LWCAn agent's console shows a banner the moment a payment fails in the billing system
Data virtualizationData stays outside Salesforce and is read on demandSalesforce Connect external objects (OData, cross-org, custom adapter), or an LWC calling an APIAgents see 10 years of order history from the data warehouse without copying it

How to choose: Does the user need the answer now (request-reply) or just need it to happen (fire-and-forget)? Is the data small and live (virtualize, request-reply) or large and reportable (batch sync)? Who owns the data (system of record)?

Middleware (MuleSoft or another iPaaS) usually sits in the middle for transformation, routing, retries, monitoring and security. API-led connectivity separates system APIs (one per back end), process APIs (orchestration) and experience APIs (per consumer).

Real-world analogy

Ordering in a restaurant. Request-reply: you ask the waiter if the fish is fresh and wait for the answer. Fire-and-forget: you hand in your order and go back to your conversation; the food arrives later. Batch sync: the kitchen's nightly delivery from the wholesaler. Remote call-in: the delivery company rings the restaurant to say the order is ready. UI update: the buzzer on your table lights up. Virtualization: the menu shows today's specials from the kitchen's board instead of printing new menus.

Worked example

A retail bank's onboarding, described pattern by pattern:

  • The adviser clicks Run KYC β†’ request-reply to the KYC provider (2-second timeout, cached last result as fallback).
  • The application is approved β†’ fire-and-forget: a platform event triggers middleware, which opens the account in core banking and calls back with the account number (remote call-in).
  • Every night, balances for all customers load into a summary field β†’ batch data sync with Bulk API 2.0.
  • When core banking flags a failed direct debit, the adviser's console shows an alert β†’ UI update based on data changes through a platform event and empApi.
  • Transaction history is shown from core banking without copying it β†’ data virtualization via an external object or an LWC calling an API.

Diagram

Rendering diagram…

Key points

  • Six patterns: request-reply, fire-and-forget, batch sync, remote call-in, UI update on data change, data virtualization.
  • Choose by timing (wait or not), volume, data ownership and who initiates.
  • Request-reply needs timeouts and a fallback; fire-and-forget needs acknowledgement, retries and status back.
  • Batch sync uses Bulk API 2.0 and external IDs for upserts.
  • Virtualization keeps data at the source: no storage, but limited reporting and dependency on availability.
  • Middleware adds transformation, routing, retries, monitoring and API-led layering.

Limits and gotchas

  • Synchronous callouts from the UI make Salesforce as slow as the slowest back end; long-running ones count toward the concurrent long-running request limit βš‘ verify current limit.
  • Callouts after uncommitted DML in the same transaction aren't allowed; design the order or go async.
  • Fire-and-forget without status back leaves users blind. Always design the return path (status field, event, or log).
  • Virtualized data can't drive most automation (no triggers on external objects) and is limited in reports.
  • Batch windows collide with business hours across time zones; agree them with the business.

🎀 How to say this in an interview

Interviewers give you a requirement and expect you to name the pattern, the Salesforce mechanism and the error handling in one breath: "That's fire-and-forget: a platform event, consumed by middleware, with an idempotency key and a status callback." Prepare one scenario per pattern from your own experience.

Common follow-ups

When would you put middleware in between instead of calling the system directly?

When there's transformation, routing to several systems, retries and monitoring to manage, many consumers of the same back end, or security boundaries (network, credentials). For a single, simple, well-behaved API, a direct Named Credential callout can be enough.

How do you make fire-and-forget reliable?

Persist the intent (platform event with publish-after-commit, or an outbox record), use idempotency keys, have the receiver acknowledge, retry with back-off, send status back to Salesforce, and alert on items stuck beyond a threshold.