Sub topic 1
Why leave data where it is: virtualization versus copying
Salesforce Connect lets an org show and work with data that stays in another system. This chapter explains the idea behind it, which is data virtualization, and compares it with the more familiar approach of copying data into Salesforce. By the end you should be able to decide which approach fits a given requirement and describe what happens at runtime when a user opens an external record.
Prerequisites
This chapter assumes you already know:
- The basic Salesforce data model: objects, fields, and relationships.
- How to navigate Setup and how permission sets grant access.
- Basic SOQL, meaning
SELECTwithWHERE,ORDER BY, andLIMIT. - A rough idea of what a REST API or an OData service is. This is helpful but not required yet.
You do not need Apex for this chapter. The Apex examples in later chapters build on the ideas here.
Two ways to bring outside data into Salesforce
Suppose a company keeps its product catalog in an ERP system, which is a back-office system for orders, inventory, and finance. Sales reps work in Salesforce and need to see the catalog while they build quotes. There are two broad ways to make that data visible.
- Copy it. Load the catalog into Salesforce objects and keep the copy up to date. This is data integration, often called data replication or ETL (extract, transform, load).
- Virtualize it. Leave the catalog in the ERP system. When a user asks for a product, Salesforce fetches it from the ERP system at that moment and shows it. Nothing is stored in Salesforce.
Data virtualization is the second approach. Salesforce keeps a definition of the external data, but the rows themselves stay in the source system. Salesforce Connect is the product that implements this approach, and the objects it creates to represent the external tables are called external objects.
How copying works
When you copy data, the records become ordinary Salesforce records. Typical tools are Data Loader, an ETL product, middleware, or custom Apex and API code. A sync job usually runs on a schedule or reacts to change events from the source.
What you get:
- Fast reads, because the data is local to the org.
- Full platform features: reports, dashboards, flows, triggers, validation rules, sharing rules, and search.
- Independence from the source. If the ERP system is down, Salesforce still has its copy.
What you pay:
- Storage. Copied records count against your org's data storage limits.
- Staleness. The copy is only as fresh as the last sync. A price changed a minute ago may still show the old value.
- Sync logic. Someone has to build and maintain the jobs, handle failures, deal with deletes, and resolve conflicts if both systems can edit the same record.
- Duplicate data. Two copies of the truth can drift apart, and a second copy may bring extra compliance obligations.
How virtualization works
With virtualization, Salesforce stores only metadata about the external data: a definition of each external table and its columns. When a user opens a page, runs a query, or loads a list view, Salesforce makes a live request (a callout) to the external system and displays the response.
What you get:
- Current data. Every read returns what the source holds right now.
- No storage cost for the external rows, because they are not stored in the org.
- No sync jobs to build or monitor.
- One source of truth. The external system remains the owner of the data.
What you pay:
- Latency. Each read depends on a network round trip to another system. It is slower than reading local data.
- Availability coupling. If the external system is slow or down, the pages and queries that depend on it are slow or fail.
- Feature gaps. External objects do not support every platform feature. For example, you cannot fire triggers on reads, and many reporting and automation options are limited compared with standard and custom objects. Later chapters cover these limits in detail.
- Limits on callouts. Live requests count against limits, so heavy use needs planning.
The runtime flow
The difference is easiest to see by following one request. A user opens a list of products in Salesforce.
With a copy, the middle two steps vanish: Salesforce answers from its own database. With virtualization, the user's wait includes the external system's response time.
Here is what a query against an external object looks like. The object name Product__x ends in __x, which marks it as an external object. ExternalId and DisplayUrl are standard fields every external object has, and fields ending in __c are custom fields that map to columns in the source.
SELECT ExternalId, DisplayUrl, Name__c, Price__c
FROM Product__x
WHERE Price__c > 100
ORDER BY Name__c
LIMIT 20This is ordinary SOQL. The difference is what happens after you run it: Salesforce Connect converts the query into a request the external system understands and sends it out. The filter, sort, and limit are passed along where the source can handle them, so the external system does the work and returns only the rows needed.
Comparing the two approaches
| Question | Copying | Virtualization |
|---|---|---|
| Where do rows live? | In Salesforce | In the external system |
| How fresh is the data? | As fresh as the last sync | Current at read time |
| Uses Salesforce data storage? | Yes | No, for the rows themselves |
| Read speed | Fast, local | Depends on the network and the source |
| Works if the source is down? | Yes, with stale data | No, reads fail or time out |
| Platform feature support | Full | Limited for external objects |
| Build effort | Sync jobs and error handling | Configuration, mostly |
| Typical fit | Core business data used in reports and automation | Large, reference, or fast-changing data viewed on demand |
Deciding between them
No rule fits every case. These questions help.
- How often is the data needed? Data that users look at occasionally, such as an order history or a catalog, suits virtualization. Data used on every page or in nightly batch jobs suits copying.
- How large is it? A table with hundreds of millions of rows may not be affordable to store in Salesforce. Virtualization lets users reach a small slice through filters.
- How fresh must it be? If a stale value causes real harm, such as a stock level or account balance, live reads are attractive.
- Do you need Salesforce features on it? If you must report across it, run triggers or flows when it changes, or use it in complex sharing rules, copying is usually the safer choice.
- Can the source handle the load? Each page view becomes traffic to the external system. Confirm it can answer quickly and at the expected volume.
- What are the data residency rules? Some data must not leave its home system. Virtualization shows the data without storing it, though you should confirm with your compliance team how transient display is treated.
Common mistakes
- Treating external objects as normal objects. They look similar in the UI, but features such as triggers on reads, some report types, and some sharing options do not behave the same way. Check support before you promise a feature.
- Ignoring the source system's capacity. A list view that loads many pages can generate many requests. Test with realistic usage.
- Expecting offline resilience. A virtualized read has no fallback. Plan what users should see when the source is unavailable.
- Copying everything "just in case". This brings back the storage and sync costs that virtualization was meant to avoid.
- Forgetting that freshness cuts both ways. Live data changes between two reads. A user who opens a record twice may see two different values.
Where this fits in the rest of the tutorial
The next chapters build the pieces that make virtualization work. First comes Salesforce Connect itself and its adapters. Then authentication, the external data source, and Validate and Sync, which generates external objects from the source's schema. After that come permissions, UI exposure, relationships, queries, writes, limits, and custom adapters. Each step makes the live-read model from this chapter more concrete.
Exercise
A support team needs to see a customer's full invoice history, which lives in a billing system with 400 million rows. Agents look up one customer at a time, a few times a day. Management also wants a weekly Salesforce report of total invoiced amount per account. Which approach would you choose, and why?
Show answer
Use a hybrid. Virtualize the invoice detail with external objects, because the table is very large, lookups are occasional and filtered to one customer, and storing 400 million rows would be costly. For the weekly report, external objects have limited reporting support, so copy or summarize the totals into a field on the Account, for example with a scheduled job that writes the weekly sum from the billing system. Agents get current invoice detail on demand, and the report works on local data.
Exercise
Name three costs of virtualization that do not exist when data is copied into Salesforce.
Show answer
Any three of: added latency from a live callout on each read; dependence on the external system's availability; limited support for platform features such as triggers on reads and some reporting options; callout limits that count against the org; load placed on the external system by Salesforce page views.