例えばルーム内のゲーム情報の管理など。
ただしworkerは長時間稼働ができないので、ユーザーがDOにalermを送る形式となる。
📌 Durable Objects の料金概要
🚀 プラン
-
Free(無料)プラン
-
SQLite ストレージバックエンドのみ利用可能
-
制限を超えると該当リソースの処理が失敗する(課金なし)Cloudflare Docs
-
-
Paid(有料)プラン
-
SQLite または Key-Value(KV)ストレージバックエンド を選択可能
-
Workers Paid プラン(月額 $5 のベース費用)が前提になる場合が多い(※参考実装例)Cloudflare Docs
-
🧮 課金対象と料金
1) Compute(実行時間・リクエスト)
| 項目 | 無料枠 | 有料料金 |
|---|---|---|
| リクエスト数 | 100,000 / 日 | 1,000,000 / 月 included |
| 追加リクエスト | — | $0.15 / 1M リクエスト |
| Duration(Durable Object 活動時間) | 13,000 GB-s / 日 | 400,000 GB-s / 月 included |
| 追加 Duration | — | $12.50 / 1M GB-s |
(GB-s = 持続時間 × メモリ量 / 1GB)Cloudflare Docs
2) Storage(永続ストレージ)
📌 SQLite バックエンド(推奨)
| 項目 | 無料枠 | 有料料金 |
|---|---|---|
| 読み込み | 5M / 日 | 25B/月 included |
| 書き込み | 100k / 日 | 50M/月 included |
| ストレージ容量 | 5 GB total | 5 GB-month included |
| 追加 | — | $0.001 / 1M rows read $1.00 / 1M rows write $0.20 / GB-month |
※SQLite Storage の課金は 2026 年 1 月以降適用予定と公式にアナウンスあり。Cloudflare Docs
📌 Key-Value バックエンド(Paid プランのみ)
| 項目 | 無料枠 | 有料料金 |
|---|---|---|
| Read 単位 | 1M | included |
| Write 単位 | 1M | included |
| Delete 単位 | 1M | included |
| Stored Data | 1 GB | included |
| 追加 | — | $0.20 / 1M read units $1.00 / 1M write units $0.20 / GB-month |
(Key-Value は読み書きサイズ単位で課金)Cloudflare Docs
📊 例:ざっくり月額コスト
-
低トラフィック用途
-
リクエスト 1.2M、Duration 50,000GB-s 程度 → おそらく 数ドル〜$10 程度 / 月
(無料枠内でほぼ収まる場合)TheServerless.Dev
-
-
WebSocket / リアルタイム用途
-
多数接続 & 長時間活動 → Duration 増 → 数十〜数百ドルに到達可能
(例: 100 DO × 50WS × 活動 → $130 程度)Cloudflare Docs
0 件のコメント:
コメントを投稿