메뉴
HN
Hacker News 51일 전

AI 코딩 앱을 위한 최적의 백엔드, Instant 1.0 공개

IMP
8/10
핵심 요약

4년여의 개발 끝에 AI 코딩 에이전트를 풀스택 앱 빌더로 만들어주는 오픈소스 백엔드 플랫폼 Instant 1.0이 출시되었습니다. 이 플랫폼은 유휴 상태에서 앱을 동결시키지 않아 무제한 앱을 즉시 생성할 수 있는 멀티테넌시(Multi-tenant) 아키텍처와 오프라인 및 실시간 동기화를 지원하는 강력한 동기화 엔진(Sync engine)을 제공합니다. 개발자는 복잡한 인프라 구축 없이도 Linear나 Notion 같은 현대적인 앱을 손쉽게 만들 수 있게 되어, AI 기반 에이전트의 앱 배포 생태계가 한층 더 빠르고 효율적으로 발전할 전망입니다.

번역된 본문

Instant 대시보드: AI가 코딩한 앱을 위한 백엔드 Joe, Stepan, Daniel, Drew (19분 소요)

4년 만에 저희는 Instant 1.0을 출시하게 되었습니다! Instant는 여러분이 즐겨 쓰는 코딩 에이전트를 풀스택 앱 빌더로 변신시켜 줍니다. 그리고 저희는 완전한 오픈소스입니다. [1]

저희는 Instant가 AI가 코딩하는 앱에 사용할 수 있는 가장 완벽한 백엔드라고 자신 있게 말씀드립니다. 이 글에서는 두 가지를 다룰 것입니다. 첫째, 여러분이 직접 판단하실 수 있도록 일련의 데모를 보여드리겠습니다. 둘째, 아키텍처를 설명하겠습니다. 실시간, 관계형, 그리고 멀티테넌시 백엔드의 한계점들은 저희가 몇 가지 흥미로운 설계를 선택하도록 이끌었습니다. 저희는 Postgres 위에 멀티테넌트 데이터베이스를 구축했고, Clojure로 동기화 엔진을 만들었습니다. 이 모든 것이 어떻게 작동하는지, 그리고 지금까지 배운 것들을 공유하겠습니다. 본격적으로 시작해 보죠.

데모 Instant를 선택하면 세 가지 이점을 얻습니다. 무제한 앱을 만들 수 있으며, 결코 정지(동결)되지 않습니다. 동기화 엔진(Sync engine)이 제공되어 오프라인에서도 작동하고 실시간이며 매우 빠릅니다. 더 많은 기능이 필요할 때 인증, 파일 스토리지, 프레즌스(presence), 스트림(streams)과 같은 내장 서비스를 이용할 수 있습니다. 이것이 무슨 의미인지, 각각의 특징을 자세히 살펴보고 어떻게 구현되는지 보여드리겠습니다.

무제한 앱 (Unlimited Apps) 전통적으로 앱을 온라인에 호스팅하려면 가상 머신(VM) 비용을 지불하거나 제한을 받습니다. 많은 서비스가 무료로 만들 수 있는 앱의 수를 제한하고, 유휴 상태가 되면 앱을 동결시킵니다. 동결을 해제하는 데는 종종 30초 이상, 때로는 몇 분이나 걸립니다. 저희는 이 점이 마음에 들지 않았습니다. 그래서 Instant에서는 원하시는 만큼 프로젝트를 생성하셔도 되며, 절대 앱을 동결시키지 않습니다.

Instant는 멀티테넌시(Multi-tenant)로 설계되었기 때문에 이것이 가능합니다. 새 프로젝트를 생성할 때 저희는 VM을 띄우지 않습니다. 단지 멀티테넌시 인스턴스에 몇 개의 데이터베이스 행만 추가할 뿐입니다. 앱이 비활성 상태일 때는 컴퓨팅이나 메모리 비용이 전혀 발생하지 않습니다. 활성 상태일 때조차 VM에 필요한 수백 메가바이트와 달리 단지 몇 킬로바이트의 추가 RAM 오버헤드만 발생합니다. 즉, 진정으로 무제한 앱을 만들 수 있습니다.

사실 이 과정은 매우 효율적이어서, 이 글 안에서 바로 앱을 만들어 드릴 수 있습니다. 가입도 필요 없습니다. 버튼을 클릭하면 독립된 백엔드를 얻게 됩니다.

앱 만들기 버튼을 누르면 백엔드가 생성됩니다. 여러분의 컴퓨터까지 왕복하는 시간을 포함해도 전체 과정은 단 몇 밀리초밖에 걸리지 않습니다.

백엔드를 식별할 공개 앱 ID(App ID)와 권한 있는 변경을 할 수 있는 비공개 관리자 토큰(Admin Token)을 받게 됩니다. 여기에는 관계형 데이터베이스, 동기화 엔진, 그리고 인증 및 스토리지 같은 추가 서비스가 포함됩니다. 무제한 앱과 에이전트를 결합하면 전혀 다른 방식으로 개발을 시작하게 될 것입니다. 오늘날 이미 에이전트를 사용하여 수많은 앱을 만들 수 있습니다. Instant를 사용하면 이 앱들을 프로덕션 환경으로 배포할 때 어떠한 제약도 받지 않게 됩니다.

동기화 엔진 (Sync Engine) 앱을 만들었다면, 이제 어떻게 훌륭한 앱으로 만들까요? 전통적인 CRUD 앱을 만드는 것은 쉽습니다. 에이전트에게 데이터베이스 마이그레이션, 백엔드 엔드포인트, 클라이언트 측 스토어를 연결하도록 지시하기만 하면 됩니다. 하지만 이런 앱을 매력적으로 만드는 것은 어렵습니다.

전통적인 CRUD 앱을 Linear, Notion, Figma 같은 현대적인 앱과 비교해 보십시오. 현대적인 앱은 멀티플레이어를 지원하고 오프라인에서도 작동하며 매우 빠릅니다. Linear에서 할 일을 변경하면 어디에서든 반영됩니다. Notion에서 오프라인이 되어도 문서에 여전히 주석을 달 수 있습니다. Figma에서 도형의 색을 칠할 때 서버를 기다리지 않고 즉시 결과를 볼 수 있습니다.

이러한 종류의 앱은 맞춤형 인프라가 필요합니다. 실시간을 위해서는 상태 저장 웹소켓 서버(stateful websocket servers)를 추가합니다. 오프라인 모드를 위해서는 IndexedDB에 캐시를 저장합니다. 그리고 낙관적 업데이트(optimistic updates)를 위해 클라이언트에서 변경 사항을 적용하고 되돌리는 방법을 고안해야 합니다. Linear, Notion, Figma 모두 이를 처리하기 위해 맞춤형 인프라를 구축했습니다. 업계에서는 이러한 인프라를 동기화 엔진(sync engine)이라고 부릅니다. [2] 개발자는 데이터가 로컬에 있는 것처럼 UI를 작성하고 데이터를 쿼리합니다. 동기화 엔진은 백그라운드에서 모든 데이터 관리를 처리합니다. 현대적인 앱에 동기화 엔진이 필요하다면, 여러분이 직접 그것을 밑바닥부터 만들어야 할 이유는 없습니다.

원문 보기
원문 보기 (영어)
instant instant Product Product Pricing Tutorial Examples Recipes Docs Essays About 9 . 8 k stars Dashboard A backend for AI-coded apps Joe & Stepan & Daniel & Drew 19 min read After 4 years, we’re releasing Instant 1.0! Instant turns your favorite coding agent into a full-stack app builder. And we’re fully open source. [ 1 ] Our claim is that Instant is the best backend you could use for AI-coded apps. In this post we’ll do two things. First we’ll show you a series of demos , so you can judge for yourself. Second, we’ll cover the architecture . The constraints behind a real-time, relational, and multi-tenant backend pushed us towards some interesting design choices. We built a multi-tenant database on top of Postgres, and a sync engine in Clojure. We’ll cover how all this works and what we’ve learned so far. Let’s get into it. Demos When you choose Instant you get three benefits: You can make unlimited apps and they’re never frozen. You get a sync engine, so your apps work offline, are real-time, and feel fast. And when you need more features you have built-in services: auth, file storage, presence, and streams. To get a sense of what we mean, I’ll dive into each point and show you how they look. Unlimited Apps Traditionally, when you want to host apps online you either pay for VMs, or you’re limited. Many services cap how many free apps you can make, and freeze them when they’re idle. Unfreezing can often take more than 30 seconds and sometimes a few whole minutes. We thought this sucked. So with Instant, you can spin up as many projects as you like and we’ll never freeze them. We can do this because Instant is designed to be multi-tenant. When you create a new project, we don’t spin up a VM. We just insert a few database rows in a multi-tenant instance. If your app is inactive, there are no compute or memory costs at all. And when it is active, it’s only a few kilobytes of extra RAM in overhead — as opposed to the many hundreds of megabytes required for VMs. This means you can truly create unlimited apps. In fact, the process is so efficient that we can create an app for you right inside this essay. No sign up required. If you click the button, you’ll get an isolated backend: Create an app And with that we have our backend. Including the round-trip to your computer, the whole process takes a few hundred milliseconds. Actual time: Click to see You get a public App ID to identify your backend, and a private Admin Token that lets you make privileged changes. This gives you a relational database, sync engine, and the additional services we mentioned, like auth and storage. Combine limitless apps with agents, and you’ll start building differently. Today you can already use agents to make lots of apps. With Instant you’ll never be blocked from pushing them to production. Sync Engine But once you create an app, how do you make it good? It’s easy to build a traditional CRUD app. Just get an agent to wire up some database migrations, backend endpoints, and client-side stores. But it’s hard to make these apps delightful . Compare a traditional CRUD app to modern apps like Linear, Notion, and Figma. Modern apps are multiplayer, they work offline, and they feel fast. If you change a todo in Linear, it changes everywhere. If you go offline in Notion, you can still mark up your docs. When you color a shape in Figma, it doesn’t wait for a server, you just see it. These kinds of apps need custom infrastructure. For real-time you add stateful websocket servers. For offline mode you store caches in IndexedDB. And for optimistic updates, you figure out how to apply and undo mutations in the client. Linear, Notion, and Figma all built custom infra to handle this. As an industry we’ve called their infra sync engines [ 2 ] . Developers write UIs and query their data as though it was locally available. The sync engine handles all the data management under the hood. If modern apps need sync engines, then you shouldn’t have to build them from scratch each time. So we built a generalized sync engine in Instant. Every app comes with multiplayer, offline mode, and optimistic updates by default. You can try it yourself. Since we’ve created our isolated backend, let’s go ahead and use it: Spin up a backend to try the live demo. Try the demo What you’re seeing are two iframes that render a todo app. They’re powered by the backend you just created (we passed the iframes your App ID). Now if you add a todo in one iframe, it will show up in the other. If you go offline, you can make changes and they will sync together. You can try degrading your network, and changes will still feel fast. And here’s what the todo app’s backend code is like: App.tsx import { init , id } from &#x27;@instantdb/react&#x27; ; const db = init ( { appId : &#x27;YOUR_APP_ID&#x27; } ) ; function App ( ) { const { data } = db . useQuery ( { todos : { } } ) ; const addTodo = ( text ) => db . transact ( db . tx . todos [ id ( ) ] . update ( { text , done : false } ) , ) ; const toggleTodo = ( todo ) => db . transact ( db . tx . todos [ todo . id ] . update ( { done : ! todo . done } ) , ) ; return ( < TodoUI todos = { data ?. todos ?? [ ] } onAdd = { addTodo } onToggle = { toggleTodo } /> ) ; } That’s about 25 lines. This is even more concise than if you had built a traditional CRUD app. You would have needed to write backend endpoints and frontend stores. Instead you just make queries and transactions directly in your frontend. db.useQuery lets you write relational queries and they stay in sync. db.transact lets you make changes and it works offline. This is better for you as a builder: the code is understandable and it’s easy to maintain. It’s better for your users: they get a delightful app. And it’s better for your agents. Sync engines are a tight abstraction [ 3 ] , so agents can use them to write more concise code with fewer tokens and fewer mistakes. Additional Services You saw data sync, but it doesn’t stop there. Apps often need more than data sync. For example, right now every person who opens our demo app sees the same set of todos. What if we want to add auth or permissions? We may also want to support file uploads, or a “who’s online” section. Or heck maybe we add an AI assistant, and would need infra to stream tokens to the client. These are common features that most apps need. But often we have to string together different services to get them. Not only is that annoying, but it introduces a new level of complexity. When you manage multiple services, you manage multiple sources of truth. So to make it easier to enhance your apps, we baked in a bunch of common services inside Instant. Each service is built to work together as a single, integrated system. To get a sense of these services, let’s look at our todo app again, but this time we’ll add support for file uploads: Spin up a backend to try the file upload demo. Try the demo What would be the traditional way to do this? We would first create a files table in our transactional database, and link it to todos . But then we would need to store the actual file blobs, so we’d probably add S3. Once we add S3, we have multiple sources of truth to deal with. If we delete a todo for example, we’d need to run a background worker to get rid of the corresponding blob in S3. With Instant, all of this is a non-issue. You get File Storage by default, and file objects are just rows in your database. They’re just like any other entity: you can create them, link them to other data, and run real-time queries against them. This means you can even create CASCADE delete rules, so you can say “when you delete todos, delete files”. There’s no need for background workers. Instead of multiple sources of truth, you get one integrated database. The shared infra handles all the edge cases under the hood [ 4 ] . And this is just Instant Storage. You also get Auth. You can use Magic Codes, OAuth, and Guest Auth out of the box. Plus when your users sign up, they’re just row