① Overview
② Request Flow
③ Data Layer
④ Multi-Domain
⑤ Growth Flywheel
// Key Highlights
Core Principle
1 codebase, 1 deployment, N domains. All domains go through the same Cloudflare zone (dbio.ai) and are routed to the same Workers.
Adding a New Domain
Just 1 API call to Cloudflare (create Custom Hostname) + 1 row INSERT into D1. No redeployment needed.
Estimated Cost
CF Workers $5/mo, D1/KV/R2 free tier is very generous. Total under $50/mo for early stage.
// Request Flow Details
Response Time
Cache HIT: < 5ms at the edge. Cache MISS (first request): 200-500ms due to SSR. Then cached for 30 minutes.
Store Isolation
Every query includes WHERE store_id = ?. Never cross-store except for the marketplace on dbio.ai.
Canonical SEO
Satellite domain is always canonical. dbio.ai always points canonical back to the satellite. Avoids duplicate content penalty.
// Data Strategy
D1 — Source of Truth
All critical data (bios, users, bookings) stored in D1. SQLite at the edge, query < 5ms. Supports transactions.
KV — Read-heavy Cache
Store config, rendered HTML, sessions. Reads < 1ms at the edge. Eventually consistent — ideal for cache, not for frequently changing data.
R2 — Binary Storage
Images, videos, file uploads. S3-compatible, 0 egress fee. Served directly via custom domain CDN.
// Comparison: Old vs New
❌ Old Way (1 repo per domain)
Clone repo → config → deploy separately. Adding a domain = adding a deployment. Update UI = deploy N times. Maintain N codebases.
✅ dbio.ai (1 codebase)
Adding a domain = 1 API call + 1 DB row. Update UI = deploy once. Maintain 1 codebase. Cost: 1 Worker deployment.