Instant 1.0, a backend for AI-coded apps

https://www.instantdb.com/essays/architecture

A backend for AI-coded apps

Instant 1.0 is out! This essay shows a bunch of demos, to explain why we think Instant is the best backend for AI-coded apps. We also cover the architecture that makes all of it work.

I wonder if people really need this. How many people are really building multiplayer apps like Figma, Linear etc? I'm guessing 99% are CRUD and I doubt that will change. Even if so, would you want to vendor lock into some proprietary technology rather than build with tried and tested open source components?

For what it's worth, Instant is 100% open source!

https://github.com/instantdb/instant

GitHub - instantdb/instant: Instant is a modern Firebase. We make you productive by giving your frontend a real-time database.

Instant is a modern Firebase. We make you productive by giving your frontend a real-time database. - instantdb/instant

GitHub

> really building multiplayer apps like Figma, Linear

I think there's two surprises about this:

1. If it was easier to make apps multiplayer, I bet more apps would be. For example, I don't see why Linear has to be multiplayer, but other CRUD apps don't.

2. When the abstraction is right, building apps with sync engines is easier than building traditional CRUD apps. The Linear team mentioned this themselves here: https://x.com/artman/status/1558081796914483201

Tuomas Artman (@artman) on X

When we started work on @linear, we felt real-time sync was a core functionality we had to invest in from the get-go. It turns out sync was important, but not for the reasons we thought. Read on.

X (formerly Twitter)
Yeah I kinda agree. Considering llms write most of the code today, the need for fancy tech is lower than ever. A good old crud app looks like a perfect fit for ai - its simple, repetitive and ai is great at sql. Go binary for backend and react for frontend - covers 99.9% use cases with basically zero resource usage. 5 usd node will handle 100k mau without breaking a sweat.

> 5 usd node will handle 100k mau without breaking a sweat.

One problem you may encounter with the 5 usd node: how do you handle multiple projects? You could put them all in one VM, but that set up can get esoteric, and as you look for more isolation, the processes won't fit on such a small machine.

With Instant, you can make unlimited projects. Your app also gets a sync engine, which is both good for your users, and at least in our experiments, the AIs prefer building with it.

And if you ever want to get off Instant, the whole system is open source.

I still resonate with a good Hetzner box though, and it can make sense to self-host or to use more tried-and-true tech.

For what it's worth, with Instant you would get a lot more support for easy projects. At least in our benchmarks, AI

This is super cool and exactly what I've been looking for for personal projects I think. I wanna try it out, but the "agent" part could be more seamless. How does my coding agent know how to work this thing?

I'd suggest including a skill for this, or if there's already one linking to it on the blog!

We do have a skill!

npx skills add instantdb/skills

Would recommend doing `bunx/pnpx/npx create-instant-app` to scaffold a project too!

Can I view the source code of this skill / install it manually? I am incredibly not a fan of automated installers for this type of stuff.

You can! The skill lives here

https://github.com/instantdb/skills

GitHub - instantdb/skills: Agent Skills for using Instant

Agent Skills for using Instant. Contribute to instantdb/skills development by creating an account on GitHub.

GitHub

Good idea! I went ahead and updated the essay:

https://github.com/instantdb/instant/pull/2530

It should be live in a few minutes.

Add a note on create-instant-app and skills by stopachka · Pull Request #2530 · instantdb/instant

Feedback from HN @dwwoelfel @nezaj @drew-harris

GitHub

One thing I have always wanted to do is cancel an AI Agent executing remotely that I kicked off as it streamed its part by part response(part could words, list of urls or whatever you want the FE to display). A good example is web-researcher agent that searches and fetches web pages remotely and sends it back to the local sub-agent to summarize the results. This is something claude-code in the terminal does not quite provide. In Instant would this be trivial to build?

Here is how I built it in a WUI: I sent SSE events from Server -> Client streaming web-search progress, but then the client could update a `x` box on "parent" widget using the `id` from a SSE event using a simple REST call. The `id` could belong to parent web-search or to certain URLs which are being fetched.
And then whatever is yielding your SSE lines would check the db would cancel the send(assuming it had not sent all the words already).

If I understood you correctly:

You kick off an agent. It reports work back to the user. The user can click cancel, and the agent gets terminated.

You are right, this kind of UX comes very naturally with Instant. If an agent writes data to Instant, it will show up right away to the user. If the user clicks an `X` button, it will propagate to the agent.

The basic sync engine would handle a lot of the complexity here. If the data streaming gets more complicated, you may want to use Instant streams. For example, if you want to convey updates character by character, you can use Instant streams as an included service, which does this extremely efficiently.

More about the sync engine: https://www.instantdb.com/product/sync
More about streams: https://www.instantdb.com/docs/streams

Sync Engine - Instant

Make every feature feel instant, be collaborative, and work offline. No extra code required.

An honest question - why would we need any frameworks at all for vibe coded apps? I can just tell the coding agent to use pure HTML5/Vanilla JS/CSS on the frontend and pure whatever on the backend and it would do it. No need for hundreds/thousands dependencies. For deployment I can ask the coding agent to do the same.

A few reasons:

1. Unlimited projects: when you spin up traditional backends, you usually use VMs. It's expensive to start many of them. With Instant, you create unlimited projects

2. User experience: traditional CRUD apps work, but they don't feel delightful. I you want to support features like multiplayer, offline mode, or optimistic updates, you'll have to write a lot more custom infra. Instant gives you these out of the box, and the agents find it easier to write than CRUD code

3. Richer features: sometimes you'll want to add more than just a backend. For example, maybe you want to store files, or share cursors, or stream tokens across machines. These often need more bespoke systems (S3, Redis, etc). Instant already comes with these out of the box, and the agents know how to use them.

There are a few demo sections in the post that show this off. For example, you can click button and you'll get a backend, without needing to sign up. And in about 25 lines of code, you'll make a real-time todo app.

Thanks, this might be exactly what I'm looking for.

I see you have support for vanilla js and svelte, but it's unclear whether you can get all the same functionality if you don't use React. Is React the only first class citizen in this stack?