Skip to content

整合與資料流動

另有 19 種語言版本

English · Español · 日本語 · Português (Brasil) · Français · Deutsch · Italiano · 한국어 · 简体中文 · Português (Portugal) · Bahasa Indonesia · Türkçe · Polski · Tiếng Việt · ไทย · Українська · Español (México) · Français (Canada) · Deutsch (Schweiz)

An open sketchbook on a drafting table at dawn, a building sketched on one page and a data model on the other, with a pencil, an eraser, a cup and a lamp.
圖片由 AI 生成

Data Architect 課程第 9 章的學習指南。請先閱讀四個模組;這一頁幫你檢查自己記住了什麼。

**關於本學習指南。**它只依據本課程自己的內容,以及 Salesforce 公開發布的考試指南中的目標清單編寫。它從不基於真實的考試題目,也不聲稱知道考試會考什麼。如果你參加過考試,請不要把考題發給我:認證協議禁止分享考題,而且死記答案本來就不是成為架構師的正確方式。

考試指南說它不考整合工具的配置,而這一章是給資料架構師的拼盤,不是 Integration Architect 課程。考試真正關心的,是整合對你的資料做了什麼:鍵、寫入權限、資料量和完整性,以及在 org 之間流動的資料。平台的數字會變,依賴它們之前請先檢視當前的數字。

邊學邊打勾。每一條都連結到講授它的地方。

畫箭頭之前(支撐 LDV-1 和 SDM-2)

  • I zoom out to the landscape, then zoom in on one arrow and ask its data questions: initiator, direction, freshness, volume and shape, key, write authority, and who proves it arrived. (Zoom In on One Arrow) ⟲
  • 我把誰發起和資料往哪個方向流動分開,也知道只有用戶端能看到完整的往返。(誰發起,不等於資料往哪裡走)
  • I treat freshness as a requirement, not a default, and match the timing to the mechanism: a synchronous call when the caller waits, platform events for fire and forget, Change Data Capture to keep another system in step, the Bulk API for large scheduled loads. (How Current Does It Need to Be?) ⟲
  • I know a database stores; a process calls: polling needs a process, often middleware, and polling for nothing is waste. Change Data Capture has a daily delivery allocation, counted per subscriber. (Asking Every Minute) ⟲
  • I know Salesforce’s guidance for pulling changes on a schedule: getUpdated() and getDeleted() for intervals over 5 minutes; more often than that, let Salesforce send the change. (Asking Every Minute) ⟲
  • I know the three traffic shapes, singles, sets and bulk; that more than 2,000 records is a good candidate for Bulk API 2.0, fewer for bulkified synchronous calls such as Composite; and to send only the fields that changed. (The Number of Zeros Applies to Integrations Too) ⟲
  • I know integration volume becomes data volume: ownership, automation, sharing and storage. (Integration Volume Becomes Data Volume) ⟲

鍵與寫入權限(支撐 SDM-2、SDM-4 和 MDM-2)

  • I carry an external system’s key in an External ID field marked Unique, one-to-one, and upsert on it: no match creates, one match updates, more than one fails. (One Record, One Key) ⟲
  • When one customer has several external records, I add records, not fields (a hierarchy, peers or a child object), never a key field per ERP. (When the Customer Is in Two ERPs, chapter 6: One Customer, Two ERPs) ⟲
  • I know one key field with the source in the value is still one key per record, and a new partner is a new value, not a new field. (Steve Trucking: One Field, the Source in the Value) ⟲
  • 我知道穩定的鍵讓重試變得安全(冪等性的起點)。(鍵讓重試變得安全)
  • I know a key isn’t authority, and enforce write authority in the org: record types, read-only fields for users, and an integration user with only the access its contract needs. (A Key Isn’t Authority) ⟲
  • I know two-way movement still has one owner per field, and how unclear authority causes loops. (Two-Way Movement, One Owner per Field) ⟲
  • 我知道一個 Salesforce org 的記錄 ID 在另一個 org 裡不是企業級的鍵:兩個 org 就是兩個系統。(鍵也有生命週期)

Proof of delivery (supports MIG-1 and MIG-2) ⟲

整合資料契約(支撐 SDM-4)

  • I can write an integration data contract for an arrow, eleven lines: initiator, direction, freshness, volume and shape, key, write authority, pattern, mechanism, proof of delivery, sensitivity and travel, and change. (An Arrow Needs More Than a Label) ⟲
  • I go requirement, then pattern, then mechanism. (Requirements, Then Pattern, Then Mechanism) ⟲
  • I know when to give another team a custom Apex REST endpoint instead of the standard APIs (one stable interface, my own logging and orchestration) and what it costs (code to maintain; API and Apex limits still apply). (A Contract Between Teams) ⟲
  • I count every place the data rests on its way, logs and retry queues included, when it has to stay in a country. (Make Each Line Specific) ⟲
  • For multiple orgs, I start with a contract per movement, and sometimes the contract says don’t move it (chapter 14). (Multiple Orgs, and “Don’t Move It”) ⟲

Where the rest lives. This chapter is about moving data. Not moving it (Salesforce Connect, mashups, data brought in on demand, zero copy: exam objective LDV-3) is chapter 14, Virtualization, Federation, and Zero-Copy (coming soon). Loading and extracting at volume is chapter 10, Migration and Synchronization. ⟲

考試是底線,不是天花板。下面這些是本章中架構師需要的習慣,不管有沒有考題問到它們。

  • Zoom out, then zoom in. Start with the landscape; then take one arrow at a time. ⟲
  • **瞭解即將到來的流量,**即使整合是別人設計的。
  • 先理解資料流動,再選擇機制。
  • A database stores; a process calls. Someone has to own the process. ⟲
  • **資料流動不是免費的。**每一份副本都是又一個需要治理的地方。
  • Add records, not fields. ⟲
  • **認清記錄。認清所有者。**然後再讓整合寫入。
  • Whoever knows what should arrive proves that it did. ⟲
  • **如果它可能悄無聲息地失敗,它就還沒有完成。**一個停了的整合就是一個資料品質問題。
  • 權限說的是能不能;架構說的是該不該。
  • Decide the interface between teams in the first weeks: the standard API or a wrapper you own. ⟲
  • 契約比技術活得更久。
  • **把代理程式的每個操作都當作一個整合,**配上鍵、權威、冪等性和可觀測性。
術語一句話解釋
發起方發起對話的系統(用戶端)
資料方向業務資料往哪個方向流動,不論誰發起
FreshnessHow current the data must be
PollingAsking on a schedule whether anything changed
單條、成組、批次一次一條記錄、小批分組,或在一個作業中處理大量資料
外部 ID存放在 Salesforce 記錄上、用於比對的另一個系統的鍵
Upsert(更新插入)如果比對的記錄存在就更新它,不存在就建立它
冪等性重複執行一個操作而不產生意外的額外效果
水位標記 / 檢查點記錄一個整合已經安全走到了哪裡
對賬比較預期的內容和實際到達的內容
Proof of deliveryEvidence, held by the side that knows what should arrive, that it did
Return receiptAn acknowledgment sent back to say a message was received and processed
Request and replyThe client sends and waits for the answer
Fire and forgetThe client sends without waiting for the outcome
平台事件在 Salesforce 事件總線上釋出給訂閱方的訊息
變更資料捕獲記錄變化時 Salesforce 釋出的事件
Replay ID訂閱方用來繼續讀取事件的位置
Custom Apex RESTYour own REST endpoint in Salesforce, written in Apex, in front of your objects
整合資料契約一份簡短記錄,說明一個整合可以對資料做什麼

按課程風格編寫的簡短情景題。開啟答案之前,先想好你的答案。

1. Salesforce 呼叫 ERP 獲取一個客戶的信用狀態。資料往哪個方向流動,誰是發起方?

Salesforce 發起;資料從 ERP → Salesforce 流動。發起方和方向是兩個獨立的問題,而發起方(用戶端)才是能看到完整往返的那一方。重讀誰發起,不等於資料往哪裡走。

2. 團隊提議為每一條 GPS 讀數建立一條 Salesforce 記錄:每天 200,000 條。你首先問什麼?

為什麼要把一年 7,300 萬條讀數放進事務型模型?這首先是一個資料架構決定,然後才是整合決定;org 可能只需要最新的位置。重讀整合的資料量會變成資料的資料量。

3. A warehouse team says, "Snowflake will just poll Salesforce every minute." What's missing? ⟲

A database stores; a process calls. Something has to run the polling (usually an integration layer), with its own credentials, schedule and failures, and 1,440 calls a day mostly find nothing. Ask how current the data must be, then consider letting Salesforce send the changes (Change Data Capture), and count the events. Reread Asking Every Minute.

⟲
4. An external system needs Salesforce's changes about every hour, including deletions. What does Salesforce's own guidance suggest? ⟲

For intervals over 5 minutes, the SOAP API’s getUpdated() and getDeleted() return what changed and what was deleted in a window, instead of a full extract. More often than that, let Salesforce send the change. Reread Asking Every Minute.

⟲
5. The ERP retries a "create customer" call after a timeout and Salesforce ends up with two accounts. How should it have been designed? ⟲

Upsert on the ERP’s customer number in an External ID field marked unique, so a retry matches the existing record instead of inserting a duplicate. Reread Keys Make Retries Safe.

⟲
6. The customer exists in two ERPs, and someone proposes `NA_ERP_ID__c` and `EMEA_ERP_ID__c` on the Account. Your view? ⟲

That’s a key field per ERP: an anti-pattern. It hides repeating structure in fields and turns every new ERP into a schema change. Add records, not fields: child accounts, peer accounts, or a child object per ERP record, each with one key. Reread When the Customer Is in Two ERPs.

⟲
7. The integration log shows zero errors, but finance totals don't match. What happened, and who should have caught it? ⟲

Zero errors isn’t completeness: maybe fewer records were sent than intended, or values changed in transit. The side that knows what should have arrived proves it did: it reconciles counts and control totals against what it meant to send. Reread Who Proves It Arrived?.

⟲
8. A subscriber to platform events was down for a day. Can it catch up? ⟲

Yes, within the 72-hour retention: it resumes from its last Replay ID. It must also handle duplicates, because the same event can arrive twice. Reread The Return Receipt.

⟲
9. The requirement says "we need a REST integration for credit holds." What's wrong with that? ⟲

REST is a mechanism, not a requirement. The requirement is something like “agents see a credit hold within five minutes of the ERP change.” Start there, choose the pattern, then the mechanism, and write the contract. Reread Requirements, Then Pattern, Then Mechanism.

⟲
10. A partner's middleware team will send orders that touch four objects, and your data model changes every release. Standard API or custom Apex REST? ⟲

It depends on the team. If they know Salesforce deeply and can change quickly, the standard APIs work. If not, a custom Apex REST endpoint gives them one stable interface, lets Salesforce orchestrate the four writes and log every call, and absorbs your changes inside. The cost is code you maintain, inside Salesforce’s API and Apex limits. Decide in the first weeks. Reread A Contract Between Teams.

⟲