Show HN: Kedge – Full-stack cloud with forkable VM snapshots and global SQLite
Posted by wgjordan 3 days ago
I'm building Kedge, a globally distributed platform for stateful serverless apps. Here's how you make a simple static site: `echo '# Hello world!' | ssh kedge.dev`
I helped build Fly.io for 4 years and shared enthusiasm for the founders' vision of a 'global Heroku'. While there, I wrote "The Serverless Server" (https://fly.io/blog/the-serverless-server/) as a study of Lambda and a sketch of a modern serverless product built around lightweight VMs. That essay was the initial inspiration for Kedge.
Kedge has a fast VM orchestrator that can create code sandboxes or scale service instances in 3ms, using a combination of forkable VM snapshots and a tree of warm pools (Linux kernel -> base runtime -> app). VMs are memory-dense thanks to shared copy-on-write memory pages. You can run lightweight CGI-style functions, public OCI images, or source code for BuildKit to compile and deploy.
Kedge's global control plane sits on an eventually-consistent SQLite database. Taking inspiration from Corrosion and Litestream, I built a local-first, multi-writer CRDT-based replication system backed by object storage, and just recently made it open source (https://github.com/wjordan/syzy).
You can also use a SQLite client to query `/shared.db` from any instance for a build-in replicated database in your app. This lets Kedge autoscale services close to your users while each instance queries its local replica for eventually-consistent data, with no need to micro-manage instance or volume placement. (There's also a /shared/ filesystem adapter for convenience.)
Kedge can even use this same database for stateful, server-rendered HTML apps. Data attributes bind forms, buttons, and values to records in the app database, Kedge compiles the schema and operations at deploy-time, and then queries the local data to serve requests. As a demo, I made a Hacker News clone with story submission, votes, comments and auth in about 60 lines of Markdown, plus CSS (https://kedge.dev/docs/html-apps#kedger-news).
I've just started collecting public feedback, so please let me know what you think! I'm particularly interested in feedback on the stateful HTML app model, which is the newest (and most ambitious) piece. The preview is currently running in 11 regions for you to kick the tires. There's no billing yet, so the pricing page is an estimate. Thanks for taking a look!
Comments
Comment by siliconc0w 1 day ago
You should license the backend to enterprises that want a cheaper/lighter weight option to kubernetes for the surge of agentically coded internal apps.
Comment by nicksuperb 3 days ago
Caught my eye with this one. I'll be taking a closer look as this is one of those "I'd rather let someone else do it." type infrastructure bits :)
Comment by wgjordan 3 days ago
Comment by devmor 3 days ago
An instant, ephemeral cloud sandbox is pretty handy.
Comment by sureglymop 3 days ago
I've been excited about using (lib)krun as a drop in replacement for crun/runc for container engines, to make them run qemu microvms. I'm exploring what it could look like if every process of an OS ran like that. I envy you, would love to work on something like this!
Comment by gandreani 1 day ago
Comment by wgjordan 1 day ago
It handles multiple writers by capturing changes as logical operations, then resolving conflicts in a globally-deterministic order based on their contents based on a CRDT model.
There are some limitations (see https://github.com/wjordan/syzy/blob/main/sqlite/docs/LIMITA...), mostly around primary keys (they have to be non-NULL) and UNIQUE constraints (there's some subtle differences in behavior between nullable and NOT NULL uniqueness). But in general, the goal is for all of SQLite, DML and DDL, to just work normally!
Comment by maclockard 1 day ago
Is it to have more sympathy for LLMs? More 1:1 with a local dev environment?
Comment by wgjordan 1 day ago
The database is eventually consistent by design. For applications that can tolerate eventual consistency across regions, this gives fast local queries everywhere, and services that are resilient to network partitions. A database sitting alone in Virginia gives you slow requests waiting on queries from distant regions, and global downtime if that one load-bearing region goes unavailable for any reason.
The platform does also support persistent volumes (https://kedge.dev/docs/volumes), which is the managed storage API. I've framed it as an escape hatch for those that still need to run a more traditional service with stable members in a fixed region.
Comment by vyedin 3 days ago
> As a demo, I made a Hacker News clone with story submission, votes, comments and auth in about 60 lines of Markdown, plus CSS
although why would you use it for evil
Comment by wgjordan 3 days ago
I couldn't help it! Ben Johnson recently wrote a Litestream post touching on this topic [1]:
> multiple-writer distributed SQLite databases are the Lament Configuration and we are not explorers over great vistas of pain
I offer my sincerest apologies if this database release may have inadvertently opened the gates of Hell.
Comment by tekacs 3 days ago
On the HN frontpage is Superlogical (I have no affiliation) right now, and I used the shell provided by the Kedge News demo to `ssh superlogical.jobs` from my browser on a phone on an instance started seconds earlier. :)
I didn't immediately spot the durability contract for volumes -- local NVMe like Fly, or sitting on some underlying system like EBS?
Comment by wgjordan 3 days ago
> I didn't immediately spot the durability contract for volumes -- local NVMe like Fly, or sitting on some underlying system like EBS?
Persistent volumes use local NVMe that continuously syncs to object storage, so a similar architecture to Fly Sprites. It automatically recovers from host failures (with on-demand lazy restore), and you can manually migrate stable members to another region if needed.
I've positioned persistent volumes as an escape hatch for when you need an existing database app running in a VM, or when performance requirements outgrow the built-in replicated SQLite.
Comment by tekacs 3 days ago
Comment by tomComb 1 day ago
Wait, are you saying it has dynamic vertical scaling of RAM?
Comment by wgjordan 1 day ago
Comment by PersonalJarvis 3 days ago
The other one is syzy. CRDT.md says eviction is operator-driven, that PRUNING.md is a design-stage contract and not yet code, and that a replica lagging beyond the hold window may transiently observe the departing duplicate, while the product headline offers scale to zero when idle, which mints offline replicas continuously. Who calls syzy_evict in the managed product?
Comment by wgjordan 3 days ago
- Yes, there is a post-restore kernel reseed hook that happens after fork, and just before the trapped listen is continued. It doesn't use the vmgenid driver, it just calls the RNDRESEEDCRNG ioctl, so it would not be compatible with applications that depend on vmgenid notifications to reseed userspace PRNGs.
- In Syzy, the full pruning implementation is deferred for now; at the managed product's current small scale, it can simply eat the tiny overhead costs of un-collected garbage, while the user is only billed for the logical storage space consumed.
Comment by AlexeyBelov 1 day ago
Comment by Bnjoroge 1 day ago
Comment by dhchun1203 1 day ago
Question on the shared SQLite: with multi-writer CRDT replication and eventual consistency, how do you handle operations that need global agreement — unique usernames at signup, or "did my vote count exactly once"? The HN-clone demo has both auth and voting, so I'm curious whether the HTML app model resolves those at the CRDT layer or accepts last-write-wins and tolerates the edge cases.
Comment by flipped 3 days ago
Comment by rent74 3 days ago
Comment by ianberdin 3 days ago
This platform powers full-stack applications for business users, including Playcode.ai.
For more information about our cloud platform, visit: https://playcode.io/cloud