Skip to content

Tool Tuesday: My Free Database Cut Me Off at 5 Million Reads

Poker players building startups. Free, Monday and Friday.

Unsubscribe in one click.

My whole community runs on a free database. On October 27 it ran out of free.

No bill. No upgrade. Just a wall.

That Tuesday, rounderstofounders.com hit Cloudflare's free daily limit of 5 million rows read. From then until 5 PM Pacific, every database call bounced. The forums and the builds page looked empty. Nobody could sign up. Even my AI team got locked out. At 12:15 my social seat filed its standup, and the first word was "BLOCKED."

That's the catch with a free tier. The bill isn't money. It's an outage.

The setup

D1 is Cloudflare's database. It's SQLite, the tiny database tucked inside half the apps on your phone, running on Cloudflare's servers. A small Worker script sits in front of it and answers the website.

Everything R2F knows lives in there. Members, threads, builds, chips, the newsletter list. 33 tables, one database, zero servers for me to babysit.

The free plan is real. Cloudflare's pricing page, as of this week: 5 million rows read a day, 100,000 rows written a day, 5 GB of storage. For a community our size that sounds bottomless.

It isn't, and the reason is one word.

The catch: "read" means scanned

Cloudflare counts every row a query looks at, not the rows it hands back. Their own example: grab everything from a 5,000-row table and you've spent 5,000 reads. Filter on a column with no index and the database still rummages through the whole table to find your matches.

So tiny tables don't save you. Our events table had about 380 rows that day. Now multiply. A page that fires a few dozen small queries, hit over and over by visitors and crawlers, chews through reads fast.

That's the engineer seat's best guess for what happened: lots of requests, most likely bots, times lots of little queries per page. A guess, not a proof. With the database capped, it couldn't even run the tools to check.

The fix: four boring moves

The engineer seat had a fix up that same afternoon. Nothing clever.

  1. Cache the public pages for 60 seconds. Forum lists, build pages, the tools directory. Repeat hits inside a minute reuse the last answer instead of pestering the database. Any new thread or reply wipes the cache, so a member still sees their post right away.
  2. Add one index. On the events table (pageviews and clicks), by type and time, so the counts stop scanning everything.
  3. Tell the truth when it breaks. Before, a dead database made the forum say "Nothing yet. Deal the first hand." Now it says "Back shortly." A site that's down and says so beats a site that's down and looks abandoned.
  4. Put a meter on it. Every D1 query reports how many rows it read. The Worker now tallies them by day, and our health check prints the running total.

Then the backstop. My CEO seat picked Cloudflare's $5 a month Workers Paid plan the same day, and I slapped my card on it the next. Per Cloudflare, that plan includes 25 billion rows read a month, then $0.001 per extra million. Upgrading lifts the free daily caps "typically within minutes."

The numbers now

The meter started logging on October 28. Twelve days, through November 8:

  • Rows read, all twelve days: 1,740,013. About a third of the one-day limit that knocked us flat.
  • Busiest day: November 7, 242,193 rows. Under 5% of the old cap.
  • Last Friday: 224,538 rows across 7,030 queries.

One honest caveat. The paid plan arrived the day after the fix, so I can't prove the cache alone would have kept us under 5 million. What I can say: twelve days of real traffic, with the cache on, never came close.

The ledger

  • Spend: $5 a month. Extra read charges so far: $0. We've used a sliver of the 25 billion.
  • Downtime: one afternoon, until the 5 PM reset.
  • Revenue from the fix: $0. That's not its job.

Who should use D1

If you're building a small site and want a real database without paying for a server, it's a good pick. It's been solid for us since the fix. Just know what the free plan is: a hard cap that cuts you off cold, then waits for midnight UTC.

Steal this

Every free tier your build leans on is a stop-loss someone else set for you. You don't pick the number, and you don't get a vote on when it fires.

So do two things today:

  1. Find the meter. Most services report usage somewhere. Cloudflare hands back rows read on every single query. Log it daily where you'll actually see it, before you need it.
  2. Build the "we're down" screen now. Never let an outage look like an empty room. A stranger who lands on a blank forum has no reason to think it's a bug.

We found our limit a week after the relaunch, the hard way. A meter on day one would have cost nothing.

R2F is a community for poker players building startups. What free tier is your build one bad day away from running out of? Tell me in the discussion thread. And if you're a poker player building something, join R2F before November 20 and you get the Founding badge. Two minutes.

— Art

Written with the R2F AI team. How that works.

Upvotes push posts up the blog’s Most upvoted list.
Share this post
Get two emails a week

Two emails a week. Unsubscribe in one click.

Comments

Join free to comment. It takes a minute.
Building something like this?

Post it and get feedback from players who’ve been there.

Join before Nov 20 and your profile carries the ♠ Founding member badge.