风易: On the free tier, do not send write operations one by one; a D1 batch can write N rows at one time
On 2026-11-17, X user @Michael_liyang (风易) wrote: on the free tier, do not send write operations one by one; what one batch write saves is the number of rows written and the number of subrequests. D1's batch can carry multiple statements at one time, and one call writes N rows. The chain is request → accumulate a batch → write once with batch → retry the whole batch on failure, and use an idempotency key as a backstop. The author's judgment: do not accumulate when real-time requirements are high; accumulate only for logs, bookkeeping, and bulk imports; write how long to accumulate into the config, and force a flush to disk on timeout.
- Products
- D1Workers
- Source
- Author experience𝕏 post
- Author
- 风易 (@Michael_liyang)
Key points
- This is a new D1 batch-write tutorial by this author. Its topic differs from the same-day guides on concurrent writes needing to be queued and on using waitUntil to put write operations in the background, so it is a separate piece.
Original sources
Published
Original post
Read on 𝕏On 2026-11-17, X user @Michael_liyang (风易) wrote: on the free tier, do not send write operations one by one; what one batch write saves is the number of rows written and the number of subrequests. D1's batch can carry multiple statements at one time, and one call writes N rows. The chain is request → accumulate a batch → write once with batch → retry the whole batch on failure, and use an idempotency key as a backstop. The author's judgment: do not accumulate when real-time requirements are high; accumulate only for logs, bookkeeping, and bulk imports; write how long to accumulate into the config, and force a flush to disk on timeout.
风易 | AI 工具链
@Michael_liyang · Original 𝕏 post
先说结论:免费档里写操作别一条一条发,批量写一次省的是写行数和子请求数。D1 的 batch 一次能带多条语句,一次调用写 N 行;链路:请求→攒一批→batch 一次写→失败整批重试,幂等键兜底。判断:实时性要求高的别攒,日志、记账、批量导入才攒;攒多久写配置,超时强制刷盘。
A reply the same day to @yuanzia66: On the free tier, the real budget is CPU time, not money. A synchronous write to D1 both occupies request CPU and slows the response; batch writes and throwing them to the background save exactly this CPU time; the quota is not used up, but the CPU cannot hold up first.
Read on 𝕏风易 | AI 工具链
@Michael_liyang · Original 𝕏 post
@yuanzia66 先说结论:对,免费档真正的预算是 CPU 时间,不是钱。同步写 D1 既占请求 CPU 又拖响应,批量写、扔后台省的就是这部分 CPU 时间;额度没花完,CPU 先顶不住。
More to read
cloudflare-cost-notify: a Worker cron that posts daily billable usage and free-tier counts to Discord
yutamoty/cloudflare-cost-notify is an unlicensed GitHub repository, pushed on 16 November 2026. A Cloudflare Worker cron at 00:00 UTC (described as 09:00 JST) reads the Billable Usage API and GraphQL Analytics API and posts yesterday’s cost, the day-over-day change, month-to-date spend, and Workers request / R2 storage / R2 Class A and B counts to a Discord webhook. A default $0.00 alert threshold turns the message red. Because the repository has no license, this entry is a summary only and the README is not archived in sources.json.
itsabhisheksood: a Cloudflare 3D Secure prompt asked to confirm a $275.68 monthly payment.
X user @itsabhisheksood (Abhishek Sood) posted a screenshot of a Cloudflare 3D Secure prompt asking to confirm a $275.68 payment, with the caption “A vibe coding mishap or something big in the making?” The prompt describes a monthly payment. X user @thisnaeem replied calling it a $275.68 monthly Cloudflare bill and asking whether an agent provisioned something or usage compounded. The product and cause are not stated. The public outcome is unknown.
Workers Free: SQLite Durable Object row-write quota can still block after the 00:00 UTC reset
Two Workers Free users with SQLite-backed Durable Objects report that after exceeding the 100,000 daily row-write allowance, storage still threw “Exceeded allowed rows written in Durable Objects free tier” after the documented 00:00 UTC reset, even though GraphQL analytics already showed 0 rows written for the new UTC day. @vendasecoplast1 saw 114,211 rows written and 399,088 rows read on 2026-11-16 UTC, then a failure at 2026-11-17 00:17:32 UTC during CREATE TABLE IF NOT EXISTS in the constructor. @dimoncheck2020 saw 103,558 rows written on 2026-11-18 UTC and 24 failed Durable Object invocations with 0 rows written between 00:00:00 and 00:35:27 UTC on 2026-11-19, with the same constructor exception at 00:35:21 UTC. No Cloudflare staff reply as of 2026-11-19.