InstantDB is an open-source, client-side database designed to simplify real-time and collaborative app development. It offers direct browser subscriptions, relational queries, and handles data fetching, permissions, optimistic updates, and offline caching. The core uses Postgres as a triple store with a Datalog engine.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are a senior full-stack engineer. Build a simplified, open-source version of 'InstantDB', a client-side real-time database, focusing on the core 'read' and 'write' functionalities directly from the browser for a chat application. The goal is to demonstrate the concept of a client-side relational database that handles optimistic updates and real-time syncing. Use Next.js 16 App Router (React 19), Tailwind v4 for styling, and integrate with a Neon Postgres database for storage. For the real-time aspect, use WebSockets. Implement a basic Datalog-like querying interface for reading data and a simple transaction builder for writing. MVP: A functional chat application where users can send messages, and new messages appear in real-time for all connected clients without page refresh. Messages should be optimistically displayed on send and persisted to Postgres. Focus on the core data flow, client-side SDK API (e.g., `useQuery`, `transact`), and server-side persistence with real-time updates. Define the database schema for messages in Postgres as a set of triples (entity, attribute, value) to emulate InstantDB's approach, e.g., (message_id, 'text', 'hello'), (message_id, 'sender_id', 'user1'). Build/Verify Gate: A fully functional chat application running locally with at least two browser windows open, demonstrating real-time message exchange and optimistic UI updates, with all messages persisting correctly to the Neon Postgres database.
The 'learn' Astro SaaS starter template could appeal to developers interested in building real-time apps with tools like InstantDB, offering a robust frontend foundation.
Hey there HN! We’re Joe and Stopa, and today we’re open sourcing InstantDB, a client-side database that makes it easy to build real-time and collaborative apps like Notion and Figma. Building modern apps these days involves a lot of schleps. For a basic CRUD app you need to spin up servers, wire up endpoints, integrate auth, add permissions, and then marshal data from the backend to the frontend and back again. If you want to deliver a buttery smooth user experience, you’ll need to add optimistic updates and rollbacks. We do these steps over and over for every feature we build, which can make it difficult to build delightful software. Could it be better? We were senior and staff engineers at Facebook and Airbnb and had been thinking about this problem for years. In 2021, Stopa wrote an essay talking about how these schleps are actually database problems in disguise [1]. In 2022, Stopa wrote another essay sketching out a solution with a Firebase-like database with support for relations [2]. In the last two years we got the backing of James Tamplin (CEO of Firebase), became a team of 5 engineers, pushed almost ~2k commits, and today became open source. Making a chat app in Instant is
Reply to the original Hacker News thread, linking to your simplified open-source project.
“I built a simplified open-source version of InstantDB to explore the core concepts of a client-side relational database with real-time updates. Here's a link to the GitHub repo and a live demo of a chat app using it, demonstrating how to achieve similar functionality with a common stack. Would love to hear your thoughts.”
Open the original ↗