billflare.

风易: On the free tier, do not brute-force concurrent D1 writes; queue first, then write serially

On 2026-11-17, X user @Michael_liyang (风易) wrote a new D1 write experience note: on the free tier, do not brute-force concurrent D1 writes; queue first, then write serially. The author says D1 writes are serial; when several requests write the same table at the same time and collide, the mild case is a retry and the severe case is a failure. The approach is: 1. Write requests enter the queue first; 2. The consumer writes serially, batch by batch; 3. On failure, return to the queue and wait for the next round. The chain is request → enter the queue → write D1 serially → return to the queue on failure. The author emphasizes that reads can be freely concurrent, and writes must be queued.

Products
D1
Source
Author experience𝕏 post
Author
风易 (@Michael_liyang)

Key points

  • This is a new D1 concurrent-write tutorial by this author. It is not merged into the author's existing D1 no-index-created guide or scheduled-task overlap guide.

Original sources

  1. Published

    Original post

    Read on 𝕏

    On 2026-11-17, X user @Michael_liyang (风易) wrote a new D1 write experience note: on the free tier, do not brute-force concurrent D1 writes; queue first, then write serially. The author says D1 writes are serial; when several requests write the same table at the same time and collide, the mild case is a retry and the severe case is a failure. The approach is: 1. Write requests enter the queue first; 2. The consumer writes serially, batch by batch; 3. On failure, return to the queue and wait for the next round. The chain is request → enter the queue → write D1 serially → return to the queue on failure. The author emphasizes that reads can be freely concurrent, and writes must be queued.

    风易 | AI 工具链

    @Michael_liyang · Original 𝕏 post

    先说结论:免费档 D1 并发写别硬顶,先排队再串行写。 D1 写是串行的,几个请求同时写一张表,撞在一起轻则重试、重则失败。 做法:1 写请求先进队列;2 消费者一批一批串行写;3 失败回队列等下一轮。 链路:请求→进队列→串行写 D1→失败回队。 读能随便并发,写必须排队,这条最容易被忽略。
  2. On 2026-11-18, in reply to @Kai_muses: Concurrent reads and queued writes — this counterintuitive point is D1's design. This queue-plus-retry layer, a mini transaction, trades latency for not losing writes; on the free tier this deal is worthwhile.

    Read on 𝕏

    风易 | AI 工具链

    @Michael_liyang · Original 𝕏 post

    @Kai_muses 对,读并发、写排队这条反直觉就是 D1 的设计。队列+重试这层 mini 事务,拿延迟换不丢写,免费档里这买卖划算。
Author experienceD1 +1

风易: On the free tier, do not log in full; logging in full burns the D1 rows-written count first

On 2026-11-14, X user @Michael_liyang (风易) wrote: on the free tier, do not log in full; what full logging burns first is the D1 rows-written count. The approach is: log all errors, with a trace id and an error code; sample only 1% of successes, enough to see the trend; write the sample rate into the config, temporarily raise it when investigating, then lower it back. The chain is request → assign a level → log all errors / sample successes → redact → persist to D1. The author's judgment: logs are for investigation, not for stockpiling for retirement; the rows written that are saved are left for real errors.

Smart Shield Argo

thanhthuanrovi: an unexpected $239 Argo Smart Routing charge on a hobby site; one-time courtesy credit requested.

Cloudflare Community user thanhthuanrovi says the account has an overdue balance of $244.00 for September 29–October 28, 2026, of which $239.00 is Argo Smart Routing usage (2.39k GB at $0.10/GB) on the zone taingo4d.com plus a $5.00 base fee. The author says it is a small non-commercial hobby project, did not realize Argo usage would grow this much as traffic increased, notes the previous invoice was only $25.40, and asks the billing team to waive or reduce the Argo charge as a one-time courtesy credit while paying the $5 base fee. After a Community MVP explains how to raise a billing ticket, the author says billing support case #02404965 was opened.

Author experienceWorkers +3

Turn free allowances into daily budgets with alerts at 70% and 90%

风易 (@Michael_liyang) says 100,000 requests a day and 5 million rows read a day are hard walls, not a safety margin: split production and test into different Workers and D1 databases, alert at 70% and 90%, and degrade before the site returns 500s.