Sub topic 1
Why leave data where it is: virtualization versus copying
Prerequisites
This chapter assumes you know the basic Salesforce data model: objects, fields, and relationships. It also assumes you can read a simple SOQL query and find your way around Setup. You don't need Apex or OData knowledge yet. Later chapters add those.
Two ways to show outside data
Sometimes the data your users need lives in another system, such as an ERP, a product catalog, or a second Salesforce org. You have two basic choices.
- Copying moves the data into Salesforce. An integration, import, or ETL job (extract, transform, load) writes the rows into standard or custom objects. Salesforce then owns a stored copy.
- Virtualization leaves the data where it is. Salesforce keeps only a definition of the data. When a user opens a record or runs a query, Salesforce fetches the rows from the other system at that moment.
Salesforce Connect is the feature that provides virtualization. The objects it creates are called external objects. Their API names end in __x, for example Product__x.
What changes with each approach
| Question | Copying | Virtualization |
|---|---|---|
| Where is the data stored? | In Salesforce | In the external system only |
| How fresh is it? | As fresh as the last sync | Current at each request |
| Storage cost | Uses Salesforce data storage | Uses none for the rows |
| Speed of reads | Fast, served from Salesforce | Depends on the external system and network |
| If the external system is down | Users still see the last copy | Reads fail |
| Reporting and automation | Full support | Limited |
Reasons to virtualize
- Large data sets. You can show millions of external rows without paying for Salesforce storage.
- Current values. Prices, stock levels, and order status are correct at the moment a user looks.
- One source of truth. You avoid sync jobs, duplicate records, and the bugs that come from copies drifting apart.
- Data you may not store. Some policies limit where data may be kept. Virtualization lets users see it without Salesforce holding it.
Reasons to copy
- Heavy reporting. Reports, dashboards, and many automation features work best on records stored in Salesforce.
- Frequent use in logic. If code or flows read the data constantly, every read becomes a callout. Callouts add latency and count against limits.
- An unreliable or slow source. Users feel every delay, and an outage removes their access.
- Offline or historical needs. A copy keeps a snapshot. A virtual view never does.
A quick example
Suppose a warehouse system holds 4 million product rows. Sales reps need to check price and stock while they work on an opportunity.
Copying all 4 million rows would use a large share of your storage. You would also need a job to keep prices current. With virtualization, you define Product__x once. When a rep opens a product, Salesforce asks the warehouse for that one row. A query like the one below turns into a live request.
SELECT ExternalId, DisplayUrl, Name__c, Price__c
FROM Product__x
WHERE Price__c > 100
LIMIT 20The rep sees the current price. Nothing is stored. The trade-off is that the page waits for the warehouse to answer.
Where this chapter leads
The next chapters show what Salesforce Connect provides, how to pick an adapter, and how to configure the connection. The working rule to carry forward: virtualize when freshness, size, or a single source of truth matters most, and copy when speed, reporting, or independence from the source matters most.
Exercise
A support team needs to see live shipment status from a carrier's system on each case, and the data is not used in reports. Would you copy or virtualize it, and what risk do you accept?
Show answer
Virtualize it. Shipment status changes often, so a copy would go stale, and since no reports need it, you don't need the data stored in Salesforce. The risk is that each view makes a live callout, so the case page depends on the carrier system's speed and availability.
Exercise
Name two reasons you might choose to copy data into Salesforce instead of using an external object.
Show answer
Any two of these: you need reports and dashboards on the data, flows or code read it constantly and callouts would be slow or hit limits, the external system is slow or unreliable, or you need a historical snapshot.