{"slug": "how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2", "title": "How I Built a Serverless Blog on Cloudflare Workers with KV and R2", "summary": "A developer has built 1001020, a serverless blog and AI gallery running on Cloudflare Workers, using KV for content storage and R2 for image assets. The system supports articles, gallery metadata, comments, sitemaps, and admin operations without a traditional server. The developer notes that a serverless blog can function as a small CMS if the storage model remains simple and routes are deliberate.", "body_md": "Canonical URL: [https://blog.1001020.xyz/](https://blog.1001020.xyz/)\n\nSuggested cover image: use a recent image from [https://blog.1001020.xyz/gallery](https://blog.1001020.xyz/gallery)\n\nI have been building a small publishing system called **1001020**, a serverless blog and AI gallery running on Cloudflare Workers.\n\nThe live site is here: [1001020 — AI Gallery & Cloudflare Experiments](https://blog.1001020.xyz/)\n\nThe goal was not to build another static blog generator. I wanted something that could publish articles, serve an image gallery, manage uploaded assets, expose structured sitemaps, and stay operational without a traditional server.\n\nThe whole public site runs on Cloudflare Workers. Articles, settings, comments, gallery metadata, and telemetry live in Cloudflare KV. Managed images are stored in R2 and served through a dedicated image domain.\n\nThe main pieces are:\n\nThe gallery is a first-class part of the site, not just a media folder. You can browse it here: [AI Gallery on 1001020](https://blog.1001020.xyz/gallery)\n\nFor this project, Workers are a good fit because the workload is mostly request routing, HTML generation, metadata reads, and small API writes. A conventional server would work, but it would add deployment and maintenance overhead that I did not need.\n\nCloudflare Workers also make it easy to keep the app close to the edge while still handling dynamic behavior. The blog can render pages server-side, expose APIs, and support admin operations without a separate Node or container deployment.\n\nThe project stores persistent content in KV using explicit keys for articles, gallery records, settings, telemetry, comments, newsletter subscribers, and other small datasets.\n\nThis shape works well for a personal publishing system because the access pattern is simple:\n\nThe main tradeoff is that KV is not a relational database. I keep data models small and explicit, and avoid pretending it can do arbitrary query workloads.\n\nImages are uploaded as managed assets and served from R2. Article content can reference those managed image URLs, and the system tracks image references so unused assets can be identified and cleaned up.\n\nThat part matters because image-heavy blogs tend to accumulate stale files quickly. Treating image references as part of the content model keeps the gallery and article system easier to maintain.\n\nThe site now ships with the boring but important search plumbing:\n\n`sitemap.xml`\n\n`image-sitemap.xml`\n\n`robots.txt`\n\nOne article that explains part of the agent workflow direction is here: [Agent Harness Loop and Graph Engineering](https://blog.1001020.xyz/article/agent-harness-loop-graph-engineering)\n\nThe biggest lesson is that a serverless blog should not be treated as a toy static page. Once publishing, images, metadata, admin operations, analytics, and sitemaps enter the picture, the system starts to look like a small CMS.\n\nCloudflare Workers can handle that shape well, but only if the storage model stays simple and the routes remain deliberate.\n\nFor 1001020, the result is a compact publishing stack that can run globally without a traditional backend server:\n\nI am still iterating on the publishing workflow, but the core system is now stable enough to share.", "url": "https://wpnews.pro/news/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2", "canonical_source": "https://dev.to/kkww_uuww_498c7d8a8be7323/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2-4g51", "published_at": "2026-08-03 18:27:31+00:00", "updated_at": "2026-08-03 18:43:11.249456+00:00", "lang": "en", "topics": ["developer-tools", "ai-products"], "entities": ["Cloudflare Workers", "Cloudflare KV", "Cloudflare R2", "1001020"], "alternates": {"html": "https://wpnews.pro/news/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2", "markdown": "https://wpnews.pro/news/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2.md", "text": "https://wpnews.pro/news/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2.txt", "jsonld": "https://wpnews.pro/news/how-i-built-a-serverless-blog-on-cloudflare-workers-with-kv-and-r2.jsonld"}}