Salesforce CRM reference architecture

How Sales Cloud, Service Cloud, Experience Cloud, the Salesforce Platform, identity and integrations fit together in one CRM estate, with failure handling and a checklist.

Banner for the GeekMidst reference architecture “Salesforce CRM reference architecture”, covering Business context and Salesforce CRM reference…

Most Salesforce CRM programmes start with one cloud and grow into several: Sales Cloud for pipeline, Service Cloud for cases, Experience Cloud for customer or partner portals, and a growing list of integrations with ERP, billing, marketing and data platforms. Without a shared picture, each addition brings its own users, credentials and sync jobs, and the org becomes hard to change safely. This page sets out a reference architecture for a Salesforce CRM estate: what each component is responsible for, how data moves, where the trust boundaries sit and what to monitor.

This is a reference design, not a description of a client system. We validate the APIs, editions, licences and permissions for each implementation. GeekMidst can design and implement it as part of Salesforce architecture consulting.

Business context

A CRM architecture serves three groups at once. Sellers need accurate accounts, opportunities and forecasts. Service teams need cases and knowledge with the full customer history. Customers and partners need self-service that shows them only their own records. One data model serves all three, so decisions about objects, sharing and integration affect everyone.

Product names have moved. Salesforce renamed its apps "Agentforce Sales" and "Agentforce Service" in October 2025, and its product pages now use Sales Cloud and Service Cloud again. Portals are documented as Experience Cloud (formerly Community Cloud). Salesforce introduced the Core, Advanced and Max editions on 3 September 2026, so check what your edition includes before designing around a feature. Our Salesforce product names guide covers the changes.

Salesforce CRM reference architecture

Reference architecture: a reusable pattern, not a live client integration

Identity and sign-inYour Salesforce orgSystems outside SalesforcePEOPLEIDENTITYCRM APPSPLATFORMEVENTS AND DATACONNECTED SYSTEMSSales and service usersemployeesCustomers and partnersexternal usersIdentity providerSSO and MFACustomer identityportal sign-inSales Cloudpipeline and forecastingService Cloudcases and knowledgeExperience Cloudportals on LWR sitesSalesforce PlatformFlow, Apex, LWCData model and sharingobjects, roles, sharing rulesExternal Client AppsOAuth for integrationsShieldif licensedPlatform Events and CDCPub/Sub APIIntegration layermiddleware or iPaaSData 360if usedMarketing Cloud Engagementif usedERP and billingsystem of record for financeOther business appssupport, telephony, HRstaff sign-inportal sign-inauthenticated sessionauthenticated sessionexternal user sessionrecord changescase automationshared recordschange eventsPub/Sub API streaminbound API callsCRM connectorMC Connect syncorders and invoicesservice updatestracking write-back
  • Salesforce product
  • Data and analytics
  • Engagement platform
  • Integration layer
  • Identity, policy and governance
  • External or custom system
  • People
  • Identity and sign-in
  • Your Salesforce org
  • Systems outside Salesforce
  • Dashed: asynchronous, optional or feedback
Diagram source (Mermaid)

Select a component to see what it is responsible for and how data moves to and from it.

Reference architecture. Editions, licences, sharing and integration patterns are confirmed per implementation.
Components and data flows (text version)
ComponentTypeResponsibility
Sales and service usersemployeesPeopleSellers, service agents, managers and admins who work inside Salesforce every day.
Customers and partnersexternal usersPeoplePeople who use self-service portals to raise cases, check orders or manage deals.
Identity providerSSO and MFAIdentity, policy and governanceYour corporate identity provider owns staff authentication, MFA and joiner-mover-leaver processes.
Customer identityportal sign-inIdentity, policy and governanceHandles registration and sign-in for external portal users, separate from staff identity.
Sales Cloudpipeline and forecastingSalesforce productSystem of record for leads, opportunities and Pipeline Forecasting. Shares accounts and contacts with service.
Service Cloudcases and knowledgeSalesforce productSystem of record for cases, entitlements and knowledge. Reads the same accounts and contacts as Sales Cloud.
Experience Cloudportals on LWR sitesSalesforce productCustomer and partner portals built in Experience Builder. Shows records only as the sharing model allows.
Salesforce PlatformFlow, Apex, LWCSalesforce productRuns automation and custom UI. Record-triggered Flow for most logic, Apex for complex or high-volume work.
Data model and sharingobjects, roles, sharing rulesSalesforce productObjects, record types, field-level security and sharing. The longest-lived design decision in the org.
External Client AppsOAuth for integrationsIdentity, policy and governanceOAuth configuration for systems that call Salesforce. Replaces connected apps, whose support ends in Summer '27.
Shieldif licensedIdentity, policy and governancePlatform Encryption, Event Monitoring, Field Audit Trail and Data Detect. Licensed separately.
Platform Events and CDCPub/Sub APIIntegration layerPublishes record changes and business events. High-volume events are retained for 72 hours for replay.
Integration layermiddleware or iPaaSIntegration layerSubscribes to events, maps payloads, retries failures and calls other systems. MuleSoft is one option.
Data 360if usedData and analyticsIngests CRM objects through its CRM connectors for unified profiles, segments and AI grounding.
Marketing Cloud Engagementif usedEngagement platformReceives CRM contacts and leads through Marketing Cloud Connect and writes tracking back.
ERP and billingsystem of record for financeExternal or custom systemOwns orders, invoices and payments. Exchanges data with CRM only through the integration layer.
Other business appssupport, telephony, HRExternal or custom systemOther systems that need CRM data or update it, each with its own API and limits.

Data flows

  1. Sales and service users → Identity provider: staff sign-in. Single sign-on through the identity provider. If it is unavailable, admins keep a break-glass login that is tested and monitored.
  2. Customers and partners → Customer identity: portal sign-in. Registration and login for external users. Failed logins are rate limited and logged.
  3. Identity provider → Sales Cloud: authenticated session. SAML or OpenID Connect session. Access within Salesforce is then set by profiles and permission sets.
  4. Identity provider → Service Cloud: authenticated session. The same SSO session gives access to Service Cloud apps the user is licensed for.
  5. Customer identity → Experience Cloud: external user session. External users get a portal session limited by their licence and the external sharing model.
  6. Sales Cloud → Salesforce Platform: record changes. Record-triggered Flows and Apex run on saves. Errors roll back the transaction and are emailed to the automation owner.
  7. Service Cloud → Salesforce Platform: case automation. Assignment, escalation and notifications run as Flow or Apex on case changes.
  8. Experience Cloud → Data model and sharing: shared records. Portal users read and write records only through the external sharing model and guest user rules.
  9. Salesforce Platform → Platform Events and CDC: change events. Change Data Capture or Platform Events publish changes after commit. Subscribers that fall behind replay from the retention window.
  10. Platform Events and CDC → Integration layer: Pub/Sub API stream. Middleware subscribes over the Pub/Sub API (gRPC). It stores the last replay ID so it can resume after an outage.
  11. Integration layer → External Client Apps: inbound API calls. Middleware authenticates through an External Client App and writes through REST or Bulk APIs as a least-privilege integration user.
  12. Data model and sharing → Data 360: CRM connector. Data 360 CRM connectors ingest selected objects on a schedule. Failed refreshes show in the data stream status.
  13. Data model and sharing → Marketing Cloud Engagement: MC Connect sync. Synchronized data sources poll chosen objects and fields. Every synced contact or lead counts as a contact in Marketing Cloud.
  14. Integration layer → ERP and billing: orders and invoices. Mapped, idempotent calls with retries. Failures go to an error queue with the source record ID.
  15. Integration layer → Other business apps: service updates. The same pattern for other systems: mapping, retries and an error queue owned by a named person.
  16. Marketing Cloud Engagement → Sales Cloud: tracking write-back. Marketing Cloud Connect writes email tracking back to CRM records for sellers and service agents.

Component responsibilities

ComponentResponsible forDesign note
Sales CloudLeads, accounts, opportunities, Pipeline ForecastingCheck which AI features your edition includes
Service CloudCases, entitlements, knowledge, contact centreKnowledge Blocks and AI-drafted articles need a Knowledge add-on licence
Experience CloudCustomer and partner portalsGuest and external users need their own sharing review
Salesforce PlatformFlow, Apex and Lightning Web ComponentsOne automation standard per object
Data model and sharingObjects, record types, roles, sharing rulesAgree it before building screens
Shield (if licensed)Encryption, Event Monitoring, Field Audit Trail, Data DetectPart of the Salesforce Guardian add-on portfolio
External Client AppsOAuth for inbound integrationsReplace connected apps before Summer '27
Platform Events and CDCPublishing changes for subscribersReplay window is limited
Integration layerMapping, retries, error queue, monitoringMuleSoft or another middleware

Data flow, step by step

  1. People sign in. Employees authenticate through your identity provider with single sign-on and MFA. Portal users sign in to Experience Cloud through customer identity.
  2. Work happens in the apps. Sellers update opportunities, agents work cases, and customers raise cases in the portal. All three read and write the same accounts and contacts.
  3. Automation runs on the platform. Record-triggered Flow handles most logic; Apex handles complex or high-volume work. See when to use Apex instead of Flow.
  4. Changes are published. Change Data Capture and Platform Events publish changes after commit. External subscribers use the Pub/Sub API (gRPC, HTTP/2, Avro).
  5. The integration layer moves data. Middleware maps payloads and calls ERP or other APIs, and writes inbound updates back through REST or Bulk APIs.
  6. Data and marketing platforms consume CRM data. Data 360 ingests CRM objects through its connectors, and Marketing Cloud Engagement syncs through Marketing Cloud Connect.

Trust boundaries and authentication

There are three boundaries. The org boundary holds your data, users and metadata; sharing, field-level security and permission sets control access inside it. The identity boundary sits with your identity provider, which should own staff authentication. The integration boundary is wherever another system calls Salesforce or Salesforce calls out.

Plan around the authentication changes Salesforce has announced:

  • Connected apps support ends in Summer '27; use External Client Apps for new integrations.
  • Refresh tokens expire after 30 days of inactivity from 4 November 2026 in production.
  • The OAuth username-password, user-agent and hybrid user-agent flows retire on 20 February 2027, and the device flow is restricted from 30 November 2026.

Keep outbound credentials in Named Credentials and External Credentials, never in code; see named credentials explained. Verify these dates in Salesforce Help before planning a cut-over.

Failure scenarios and how to handle them

FailureEffectHow to handle it
Integration token expires or an OAuth flow retiresSync stops quietlyMove to External Client Apps; alert on authentication errors
Subscriber offline longer than event retentionMissed changesReplay within the 72-hour window, then run a reconciliation job
Record-lock errors during bulk loadsPartial updatesGroup by parent record, retry with back-off, log failed IDs
Two automations update the same fieldInconsistent dataOne automation owner per object
Portal sharing too broadExternal users see other recordsReview external sharing; run the Guest User Sharing Rule Access Report
Downstream API slow or downCallouts time outMake callouts asynchronous; queue and retry in middleware

Operational monitoring

  • Integration health: failed API calls, authentication errors and queue depth, with alerts to a named owner.
  • Automation health: Flow and Apex error emails routed to a monitored inbox, and a weekly review of failures.
  • Security: Event Monitoring (with Shield) for login and API activity; Setup Audit Trail for configuration changes.
  • Limits: API consumption against your org's allocation. Check current limits in Salesforce documentation rather than assuming figures.
  • Releases: test each release in a sandbox preview; our release testing checklist helps.

Alternative approaches and trade-offs

Point-to-point integrations are quick for one or two systems but multiply credentials and failure points as the estate grows. Middleware is one more component to run, but it centralises retries, mapping and monitoring; compare them in middleware vs point-to-point APIs. Salesforce Connect shows external data as external objects without copying it, which suits reference data owned elsewhere, at the cost of depending on that system's availability. Separate orgs per business unit give independence but make a single customer view harder.

Implementation checklist

  1. 01

    Confirm editions and licences

    List Sales, Service and Experience Cloud licences and add-ons, and what each edition includes

  2. 02

    Design the data model

    Agree objects, record types, ownership and sharing before building

  3. 03

    Set the automation standard

    Decide where Flow and Apex are used and who owns each object's logic

  4. 04

    Plan identity

    SSO for staff, customer identity for portals, External Client Apps for integrations

  5. 05

    Choose integration patterns

    Middleware, events or direct APIs per system, with error handling and replay

  6. 06

    Secure the org

    Permission sets, field-level security, MFA and, if licensed, Shield

  7. 07

    Build release management

    Source control, sandboxes and a deployment pipeline

  8. 08

    Set up monitoring

    Alerts for integration, automation and security events with named owners

Questions we hear

Is this architecture taken from a client project?
No. It is a reference design. We validate the APIs, editions, licences and permissions for each implementation.
Do we need middleware for CRM integrations?
Not always. One or two simple integrations can call APIs directly. Middleware pays off when several systems share data or you need central retries and monitoring.
What should we do about connected apps?
Salesforce says connected apps support ends in Summer '27. Plan to move integrations to External Client Apps, and confirm the dates in Salesforce Help.
Can AI tools work with our CRM data?
Salesforce Hosted MCP Servers have been GA since 29 April 2026 for Enterprise Edition and above, are intended for customers with Flex Credits, and run each call as the signed-in user. See the Agentforce architecture.

Sources

  • https://www.salesforce.com/sales/
  • https://www.salesforce.com/service/
  • https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_subscribe.htm
  • https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm
  • https://www.salesforce.com/blog/winter-27-release-architect-highlights/
  • https://www.salesforce.com/platform/shield/

Plan your Salesforce CRM architecture

Tell us about your org, users and integrations. We can review your current design and propose an architecture that fits your editions and licences.

Book a consultation →

Tell us what you are trying to fix.

Share your Salesforce setup, goals and constraints. A practitioner reads every message and replies with questions, first thoughts or an honest view of whether you need outside help at all.

Talk to a Salesforce Expert
Book a Consultation