--- tags: [零件架構, cypher, 架構決策] gloss: 零件串接用 Cypher binding(YAML URL 清單)not Service Binding(wrangler.toml)——後者靜態、不適合動態 workflow。 --- # Service Binding vs Cypher Binding ← [[decisions/00-INDEX]] **來源**:`system-dev/wiki/decisions-summary.md`(Service Binding vs Cypher Binding)、`.claude/rules/03-component-architecture.md §1` **最後更新**:2026-06-27 ## 摘要 Cypher binding 是 YAML/KV 裡的 URL 清單(用戶定義、動態);Service Binding 是 wrangler.toml 的 `[[services]]`(平台內建、靜態)。workflow 層一律走 HTTP URL,禁止新增 Service Binding。 ## 重點 - Cypher binding 用 HTTP 呼叫,workflow 是用戶定義的動態圖,不能要求每改 workflow 就 redeploy。 - Service Binding 靜態、修改 wrangler.toml 要重新部署——完全違反 workflow 靈活性,故只保留 13 個邏輯零件間的歷史遺產綁定、禁止擴展。 - 新零件部署流程:`registry/components/{name}/main.go` → 編譯 `.wasm` → 包進 `.component-builds/{name}/` Worker(Hono + WASI shim)→ 獨立部署成 `arcrun-{name}.{sub}.workers.dev`(對內)+ `{name}.arcrun.dev`(對外)→ cypher 透過 HTTP fetch 呼叫。 - self-hosted 同 zone 1042 不是加 Service Binding 解——那樣更死。改用 flag 解(見卡「same-zone-1042用flag解不用binding」)。 ## 實體 - **Cypher binding**(workflow binding)— YAML/KV 裡存的 URL 清單,workflow 執行時動態查表呼叫零件。 - **Service Binding**(Cloudflare service binding)— wrangler.toml 的 `[[services]]` 區塊,靜態綁定、修改須重新部署。 - **零件串接**(component invocation)— workflow 在執行時呼叫零件的過程。 - **HTTP 呼叫**(HTTP fetch)— 用 fetch() 透過公網 URL 呼叫零件,cypher 實踐零件串接的標準方式。 - **新零件**(new component)— 新部署到 arcrun 系統的 WASM 零件(如新的第三方服務串接)。 ## 關聯 ### 內文知識關係 - Cypher binding >> 用 HTTP 呼叫 >> 零件串接 - Service Binding >> 靜態化 >> 零件串接 - 新零件 >> 禁止用 >> Service Binding - Cypher binding >> 支撑 >> workflow ### 卡片關係 - [[service-binding-vs-cypher-binding]] >> 架構前提 >> [[R2用途-平台零件不從R2讀]] - [[service-binding-vs-cypher-binding]] >> 相關事件 >> [[same-zone-1042用flag解不用binding]]