Skip to content
所有標籤

#edge

5 篇文章

Cloudflare Durable Objects:讓 Workers 有狀態、協調與 WebSocket 的那塊拼圖

Durable Objects 把一個 name 或 ID 對到全球唯一、單執行緒、帶私有 SQLite storage 的 actor。它適合 per-room、per-user、per-tenant、per-run 這種需要強一致協調的邊界;真正的設計題是 object key 要切在哪裡。

PartyKit:把每個協作 Room 變成 Edge Stateful Server

PartyKit 以 room-keyed stateful server 收斂 WebSocket coordination,適合多人協作與 presence;但 durable document、authorization、hibernation 與 platform ownership 仍要明確設計。

Cloudflare D1:跑在邊緣的 SQLite 關聯式資料庫

D1 是 Cloudflare 的 serverless SQLite 資料庫,直接綁定 Workers,支援完整 SQL(JOIN、transaction)、自動備份。適合中小規模的關聯式資料需求,NobodyClimb 把它當主資料庫用。

Cloudflare KV:全球邊緣的 Key-Value Store

KV 是 Cloudflare 的全球分散式 key-value store,讀取從最近的邊緣節點回應,延遲極低。適合快取、feature flag、暫態資料,但寫入是最終一致性。

Hono:為 Edge Runtime 而生的輕量 Web Framework

Hono 是專為 Cloudflare Workers、Deno、Bun 等 edge runtime 設計的 Web framework,比 Express 輕一個數量級,原生支援 Web Standard API,是 edge 環境下的首選。