
Hosting and infrastructure
Supabase, Cloudflare, Vercel and the runtimes under a SaaS. These notes cover what each one costs as the product grows, where each one wins, and when to move.
Start here


Supabase Storage access control stops at the CDN cache
RLS on storage.objects decides who reads a private file, but a cached signed URL can outlive its token. The four gaps, how we close them, and GDPR.
Cloudflare R2 bucket per tenant pays off for residency and deletion
R2 includes 100,000 buckets per account, then $0.10 each a month. When a bucket per tenant beats a shared prefix, and how to automate bucket setup at signup.
Cloudflare Workers AI vs the OpenAI API: where each wins
Workers AI bills $0.011 per 1,000 Neurons and runs on GPUs in over 180 cities. Here is where that beats a hosted API, and where it does not.
Bun vs Node in 2026: where each runtime wins in production
Bun 1.3 ships a full-stack runtime, Node 24 ships stable TypeScript and a test runner. We run Bun for installs and tests, Node for what serves traffic.
Cloudflare AI Gateway: caching, spend caps, dynamic routing
One URL in front of 24 native providers, with per-model cost logs, dollar spend caps and a cache you set from 60 seconds to a month. Core features are free.
Vercel vs Docker for Next.js: a $600 bill down to $90
A $600 Vercel bill drops to about $90 a month on a managed VPS with Docker. What you give up in edge, scaling and DX, and when the swap pays off.
Upstash Redis: 5 patterns for rate limiting, sessions, locks
Five production Upstash Redis patterns: rate limiting, sessions, cache-aside, distributed locks, and QStash queues, each with real cost math.
Supabase Supavisor: transaction mode, port 6543, 80ms cost
Transaction mode on port 6543 pools thousands of serverless connections, drops prepared statements and adds 30 to 80ms. When each mode is the right call.
Supabase RLS performance: 7 fixes for the 11x slowdown
Wrapping auth.uid() in a SELECT makes it run once per statement instead of once per row. Seven Supabase RLS patterns that stay fast on big tables.
Edge vs Node runtime in 2026: Next.js 16.3 deprecated Edge
Next.js 16.3 deprecates runtime = 'edge' and runs proxy.ts on Node. Where Edge still wins on latency, and where Node wins on packages and long tasks.