Long Live Global Heroku

Here's one line to put something on the Internet:

ssh kedge.dev publish '# Hello, world!'

Markdown in, web page out, served from eleven cities on six continents.

Here's another one-liner to use a built-in agent to make an application:

$ ssh kedge.dev agent 'make me a sandwich-rating app'
Building a clean sandwich-rating app with a simple submission form and a live ratings list...
https://stack-rank.kedge.run

The result is a one-file HTML app with a built-in replicated database. A rating submitted in Sydney commits in Sydney and converges asynchronously to the other cities, while the page updates in real time in every open browser. When the app is idle, storage is the only thing metered.

When you return later, the agent can pick up the existing app and keep working on it:

$ ssh kedge.dev agent --app stack-rank 'add a dozen sandwiches from around the world to the database'
Adding twelve sandwiches from around the world to the app’s database...
Added 12 sandwiches from around the world to the database, including bánh mì, Cubano, chivito, katsu sando, croque monsieur, arepa reina pepiada, and more.
https://stack-rank.kedge.run

Kedge is the platform behind these commands. It combines a CDN and replicated state with an application model that can grow from a single document into a conventional service. It continues the vision that brought me to Fly.io and shaped my four years there: a "Global Heroku".

too much software

Coding agents are leaving us with too much software. Not just code, but stateful applications with URLs, users, accumulated data, and the ongoing responsibility of maintaining and operating them.

An agent can produce an application in an afternoon or even a few minutes, but what it leaves behind can remain in use for much longer. Somebody, or something, needs to keep it reachable, update the machinery underneath it, and recover from hardware failure or code rot.

Heroku co-founder Adam Wiggins described this problem in 2011. Years earlier he'd built Catapult, a little application on a VPS that his friends kept using after he lost interest. It died from accumulated indignities of owning a server: the Mongrel process crashed, logfiles filled the disk, and the end-of-life distro could no longer take security updates. The code had barely changed, but everything around it had rotted away.

Wiggins called Heroku's answer erosion resistance: a strong separation between application and infrastructure, formalized in an explicit platform contract. As long as the application accepts this separation, the platform can replace servers, kernels, routers, and whole generations of infrastructure underneath it. That idea grew into the Twelve-Factor App: source is an immutable release artifact, processes are disposable, state outlives them in a separate backing store, and the platform owns routing, supervision, scaling, and logs.

Fifteen years later, agents are making the problem Wiggins exposed grow exponentially. One prompt at a time, a sandwich-rating app grows to include a payments system and its own cryptocurrency, eventually burying itself under a pile of Kubernetes manifests and Terraform resources. What began as a small app becomes a sprawling system with nobody responsible for day-two operations. With an explicit platform contract, agents can iterate narrowly on the application's behavior while the platform maintains and improves the infrastructure underneath.

a computer workspace

The industry's current answer to agent-made software is to hand the agent a computer. Sprites provide a durable logical computer whose filesystem survives its temporary VM. exe.dev sells persistent Linux VMs, calls its model "serverful," and suggests putting development, testing, and production on one machine for small apps.

Some mess is useful during development, and Kedge also offers a similar kind of workspace for that reason. Once an app starts to accumulate users and reliability expectations, that mess becomes a liability. It accumulates in the hand-installed package and logs filling the disk. That mess is what killed Catapult. What a production application needs is its source, state, route, releases, and history to survive while servers underneath come and go.

Heroku was "serverless" in this sense, before the word came to mean carving an application into functions: the "server" disappears behind the contract. Kedge bridges the two, offering a durable computer for development and disposable instances for production.

small software

Ask an agent for a guestbook and you'll receive a framework, ORM, migration tool, auth library, and a colony of node_modules. The machinery is cheap to generate at first, but grows expensive to maintain over time.

On Kedge, the smallest application can begin as a single HTML or Markdown document. If it needs data, declare reads and writes in the document and Kedge compiles them at deploy time into schema and queries against a built-in database:

ssh kedge.dev publish --html <<'HTML'
<form data-kedge="ratings">
  <label>Sandwich <input name="sandwich" required></label>
  <label>Score <input name="score" type="number" min="1" max="5" required></label>
  <button>rate</button>
</form>

<ul data-kedge="ratings">
  <template><li>{{sandwich}}: {{score}}/5</li></template>
</ul>
HTML

This HTML file is backed by shared, live, multi-writer data. The attributes resemble htmx, but declare data rather than requests to endpoints. The form is a plain POST, with progressive enhancement when JavaScript is enabled to queue input when offline and synchronize updates across every open browser in realtime. There is no application server or VM; the platform handles the data bindings directly.

Data bindings are Kedge's narrowest application contract. Beyond them, Kedge can run a script with a shebang as a serverless function handler, or deploy a conventional service from source or a container image. This layered application model means the architecture can start small and evolve with the app as it grows.

cheap to ignore

Most agent-made software will be so lightly used that dedicated server resources are far too expensive for them. An app that's cheap to create also needs to be equally cheap to ignore when it's not busy.

While I was at Fly.io I sketched what I called the Serverless Server: lightweight VMs restored from snapshots on demand without forcing applications into fixed function runtimes. Kedge builds on that design. A service initializes once per host; Kedge freezes its VM as it begins listening, then resumes later instances from that point with clean memory and filesystem pages shared copy-on-write.

A new instance scales out from a warm pool in about 1.5 ms. Once the app's image is present on a host, a service restores from zero ready for connections in about 16 ms; end-to-end requests take tens of milliseconds.

This scale-out performance means that even a conventional service can scale to zero between visitors, or a one-file handler can receive a fresh hardware-isolated VM for every request. Any idle app pays only for storage.

local-first software

Fly.io's founding vision of a "Global Heroku" was simple: push source to the cloud, have it built into VMs, and run it in cities close to users. As a refreshing alternative to hyperscaler regions, Fly.io made globally-distributed compute feel like a single, unified platform; a fly deploy could put an app behind an anycast network spread across the world.

State is where the illusion got thin. A Fly Volume lives on one server's local NVMe: fast and inexpensive, but a physical home for its Machine. Replication between volumes is strongly recommended, but left to the application. For many users, that's where the Global Heroku abstraction lost its shine.

Twelve-Factor also left state to a "backing service", typically a database in one region. A global application still has to route requests home or manage replication itself.

Every Kedge application instead gets a replicated SQLite database at /shared.db and a replicated file tree at /shared/, exposed as ordinary local paths. Reads and writes complete against a host-local copy; changes converge between cities and settle into object storage so the app can scale to zero. Attaching to a global database is just opening a file.

This local-first model is eventually consistent, rather than pretending Sydney and Virginia share a memory bus. A write returns after its local commit; if the host dies before the next flush, the loss window is roughly the final second of writes. Replicas normally converge in under a second, concurrent writes to the same row resolve last-writer-wins, and schema changes or unique-value claims coordinate cluster-wide and can fail retryably during a partition.

Syzy is the engine, a local-first, multi-writer replication layer for stock SQLite and Postgres binaries, inspired by Litestream and Corrosion.

Wiggins was also a champion of local-first software. In 2019 he co-wrote Ink & Switch's essay on local-first software with Martin Kleppmann, arguing that work should write locally first and synchronize later. They wrote about personal devices, and Kedge applies the same property to application state. An HTML form submission appears in the local browser, replays to the nearest replica, converges across cities, and settles into object storage.

With replicated state, durable data belongs to the application rather than any particular instance. Kedge serves a data-backed site's files and bindings directly, without an application process; a service still runs as a process, but Kedge can route around a wedged instance and start another without recovering a local disk. Software that needs a local disk for performance, governance, or other requirements can use a traditional persistent volume as an escape hatch.

branch the application, not just the code

Once an application contains data people care about, every change has to preserve or migrate it. A preview app backed by an empty database is too little, but a PR pointed directly at a production database is too much. Representative previews are hard because source, infrastructure, and state usually branch separately.

Every Kedge app has a Git repository backing its source. Clone any app and push a non-production branch; it gets an isolated preview URL with its own fork of the database and files while the production branch stays live. A fork creates a separate, long-lived application. The stack-rank app we created earlier is published as forkable, so take its sandwiches to go:

ssh kedge.dev fork stack-rank

The operation branches source, database, and files copy-on-write at one instant. Unmodified blocks remain shared, new writes stay isolated. An agent can rehearse a migration against the application as it exists, inspect the result, and discard the experiment.

Database branching is not new, and Neon is a leading example. The difference Kedge brings is branching the whole application as a unit: source, state, and route all belong to the same application lifecycle, so it's intuitive to branch the whole app as an integrated, atomic operation.

what the agent leaves behind

This year, Fly.io has increasingly focused on Sprites as "Computers for Agents." As he handed over the CEO role, founder Kurt Mackey wrote that the two principles behind Global Heroku "probably don't matter anymore". Software is becoming personal, so audiences are small and global placement matters less. To a first approximation, nobody reads documentation anymore; an agent can one-shot a deployment, so ergonomic abstractions matter less too.

I think there's truth to these changes, but believe the same premises lead somewhere else. Small audiences are not necessarily local: families, remote companies, and tiny Internet communities span continents. Applications with small audiences rarely justify operating their own distributed architecture, which is exactly why a platform is the best way to provide a reliable, shared abstraction.

And an agent can one-shot a deployment, but that says nothing about how the system keeps running. A well-designed platform contract is exactly what keeps small software from becoming an endless infrastructure project.

Agents need a computer to work in, but an application is the finished product they leave behind. I'm still fond of the old promise: build a simple app, and the platform owns all the machinery underneath.

Long live Global Heroku.