If you were building web apps around, say, 2010, you might remember the
combination of Ruby on Rails and Heroku. You'd run rails new
git push heroku master
Now look at Cloudflare. They offer Pages for static hosting, Workers for compute right at the edge, D1 for a database, and R2 for object storage. Paired with a framework like Hono, built for the edge, you get impressive speed and scale. Getting started is fast, and the deployment pipeline via Git integration is genuinely seamless – push your code, and Cloudflare handles the rest. For deploying static assets and serverless functions, the developer experience is excellent.
It's so close to a complete, integrated platform. The foundation is
solid, and much of the workflow is automated beautifully. The friction point,
the part that doesn't yet match the ease of the deployment pipeline, is integrating
the database. Configuring D1 bindings in wrangler.jsonc
This manual configuration works, but it requires careful coordination. The ideal future, discussed in the blog post, envisions a more integrated system where configuration is derived directly from a declarative schema, similar to how ORMs like Prisma operate. Imagine defining your data structure like this instead:
1 | // hypothetical schema.prisma (The Ideal) |
2 | datasource db { |
3 | provider = "sqlite" // Would map to D1 |
4 | url = "env(DATABASE_URL)" // wrangler.jsonc binding handled implicitly |
5 | } |
6 | |
7 | model User { |
8 | id Int @id @default(autoincrement()) |
9 | email String @unique |
10 | name String? |
11 | } |
Note This illustrates the ideal scenario discussed in the blog post. By defining a schema like this (using a tool like Prisma), the necessary This contrasts with the manual configuration required in the |
The problem today is that defining that nice schema.prisma
wrangler.jsonc
d1_databases
binding
database_id
wrangler d1 migrations apply
What's needed is something closer to the old Rails magic. Imagine a
hono new --with-database
wrangler.jsonc
Cloudflare clearly has the technical pieces. They have the network, the compute platform, the data services, and Hono is a great fit. They are very close to offering a genuinely integrated, batteries-included platform for edge development. They just need to provide that last layer of tooling and automation to smooth over the developer experience rough spots.
This illustrates the ideal
wrangler.jsonc
. Instead of manual configuration sections (liked1_databases
), a singleschema
key points to the definition file.In this scenario, Wrangler/Cloudflare would read
./prisma/schema.prisma
(shown next) and automatically configure the necessary D1 bindings (and potentially others like KV or R2 defined within) and handle database migrations during deployment.This declarative approach removes the manual wiring friction point.