{"id":14322712,"url":"https://github.com/instantdb/instant","last_synced_at":"2025-05-12T13:32:43.852Z","repository":{"id":253861482,"uuid":"844738531","full_name":"instantdb/instant","owner":"instantdb","description":"Instant is a modern Firebase. We make you productive by giving your frontend a real-time database.","archived":false,"fork":false,"pushed_at":"2025-04-16T05:19:16.000Z","size":14437,"stargazers_count":8372,"open_issues_count":46,"forks_count":246,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-04-16T06:38:20.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://instantdb.com","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instantdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-19T21:53:42.000Z","updated_at":"2025-04-16T00:41:55.000Z","dependencies_parsed_at":"2024-09-21T06:00:48.466Z","dependency_job_id":"acd6edc0-40f8-4167-9b22-dafcbc152789","html_url":"https://github.com/instantdb/instant","commit_stats":null,"previous_names":["instantdb/instant"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantdb%2Finstant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantdb%2Finstant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantdb%2Finstant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantdb%2Finstant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instantdb","download_url":"https://codeload.github.com/instantdb/instant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477812,"owners_count":21437049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-24T19:01:44.578Z","updated_at":"2025-04-23T17:10:35.954Z","avatar_url":"https://github.com/instantdb.png","language":"Clojure","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://instantdb.com/\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://instantdb.com/readmes/logo_with_text_dark_mode.svg\"\u003e\n      \u003cimg alt=\"Shows the Instant logo\" src=\"https://instantdb.com/readmes/logo_with_text_light_mode.svg\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca \n    href=\"https://discord.com/invite/VU53p7uQcE\" \u003e\n    \u003cimg height=20 src=\"https://img.shields.io/discord/1031957483243188235\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/instantdb/instant\" alt=\"stars\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://instantdb.com/docs\"\u003eGet Started\u003c/a\u003e · \n   \u003ca href=\"https://instantdb.com/examples\"\u003eExamples\u003c/a\u003e · \n   \u003ca href=\"https://instantdb.com/tutorial\"\u003eTry the Demo\u003c/a\u003e · \n   \u003ca href=\"https://instantdb.com/docs\"\u003eDocs\u003c/a\u003e · \n   \u003ca href=\"https://discord.com/invite/VU53p7uQcE\"\u003eDiscord\u003c/a\u003e\n\u003cp\u003e\n\nInstant is a modern Firebase. We make you productive by giving your frontend a real-time database.\n\nYou write [relational queries](https://www.instantdb.com/docs/instaql) in the shape of the data you want and Instant handles all the data fetching, permission checking, and offline caching. When you [change data](https://www.instantdb.com/docs/instaml), optimistic updates and rollbacks are handled for you as well. Plus, every query is multiplayer by default.\n\nWe also support [ephemeral](https://www.instantdb.com/docs/presence-and-topics) updates, like cursors, or who's online. Currently we have SDKs for [Javascript](https://www.instantdb.com/docs/start-vanilla), [React](https://www.instantdb.com/docs/), and [React Native](https://www.instantdb.com/docs/start-rn).\n\nHow does it look? Here's a barebones chat app in about 12 lines:\n\n```javascript\n// ༼ つ ◕_◕ ༽つ Real-time Chat\n// ----------------------------------\n// * Updates instantly\n// * Multiplayer\n// * Works offline\n\nimport { init, tx, id } from \"@instantdb/react\";\n\nconst db = init({ \n  appId: process.env.NEXT_PUBLIC_APP_ID,\n});\n\nfunction Chat() {\n  // 1. Read\n  const { isLoading, error, data } = db.useQuery({\n    messages: {},\n  });\n\n  // 2. Write\n  const addMessage = (message) =\u003e {\n    db.transact(tx.messages[id()].update(message));\n  };\n\n  // 3. Render!\n  return \u003cUI data={data} onAdd={addMessage} /\u003e;\n}\n```\n\nWant to see for yourself? \u003ca href=\"https://instantdb.com/tutorial\"\u003etry a demo in your browser.\u003c/a\u003e\n\n## Motivation\n\nWriting modern apps is full of schleps. Most of the time you start with the server: stand up databases, caches, ORMs, and endpoints. Then you write client-side code: stores, selectors, mutators. Finally you paint a screen. If you add multiplayer you need to think about stateful servers, and if you support offline mode, you need to think about IndexedDB and transaction queues.\n\nTo make things worse, whenever you add a new feature, you go through the same song and dance over and over again: add models, write endpoints, stores, selectors, and finally the UI.\n\nCould it be better?\n\nIn 2021, **we realized that most of the schleps we face as UI engineers are actually database problems in disguise.** (We got into greater detail [in this essay](https://instantdb.com/essays/next_firebase))\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"Shows how Instant compresses schleps\" src=\"https://instantdb.com/readmes/compression.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nIf you had a database on the client, you wouldn't need to think about stores, selectors, endpoints, or local caches: just write queries. If these queries were multiplayer by default, you wouldn't have to worry about stateful servers. And if your database supported rollback, you'd get optimistic updates for free.\n\nSo we built Instant. Instant gives you a database you can use in the client, so you can focus on what’s important: building a great UX for your users, and doing it quickly.\n\n## Architectural Overview\n\nHere's how Instant works at a high level:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg alt=\"Shows how Instant compresses schleps\" src=\"https://instantdb.com/readmes/architecture.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nUnder the hood, we store all user data as triples in one big Postgres database. A multi-tenant setup lets us offer a free tier that never pauses.\n\nA sync server written in Clojure talks to Postgres. We wrote a query engine that understands datalog and [InstaQL](https://www.instantdb.com/docs/instaql), a relational language that looks a lot like GraphQL:\n\n```javascript\n// give me all users, their posts and comments\n{\n  users: {\n    posts: {\n      comments: {\n      }\n    }\n  }\n}\n```\n\nTaking inspiration from [Asana’s WorldStore](https://asana.com/inside-asana/worldstore-distributed-caching-reactivity-part-1) and [Figma’s LiveGraph](https://www.figma.com/blog/how-figmas-multiplayer-technology-works/#syncing-object-properties), we tail postgres’ WAL to detect novelty and invalidate relevant queries.\n\nFor the frontend, we wrote a client-side triple store. The SDK handles persisting a cache of recent queries to IndexedDB on web, and AsyncStorage in React Native.\n\nAll data goes through a permission system powered by Google's [CEL library](https://github.com/google/cel-java).\n\n## Getting Started\n\nThe easiest way to get started with Instant is by signing up on [instantdb.com](https://instantdb.com). [You can create a functional app in 5 minutes or less](https://instantdb.com/docs).\n\nIf you have any questions, you can jump in on our [discord](https://discord.com/invite/VU53p7uQcE).\n\n## Contributing\n\nYou can start by joining our [discord](https://discord.com/invite/VU53p7uQcE) and introducing yourself. Even if you don't contribute code, we always love feedback.\n\nIf you want to make changes, start by reading the [`client`](./client/) and [`server`](./server/) READMEs. There you'll find instructions to start Instant locally.\n\n## YourKit\n\nWe're using YourKit to help us debug Instant. They are kindly supporting Instant and other open source projects with their [full-featured Java Profiler](https://www.yourkit.com/java/profiler/index.jsp).\n\n![yklogo](https://github.com/user-attachments/assets/64788da3-1dc4-4aa6-84cd-e051fd059fd0)\n","funding_links":[],"categories":["Databases","Clojure","TypeScript","前端开发框架及项目","SaaS/PaaS Alternatives","数据库","\u003ca name=\"Clojure\"\u003e\u003c/a\u003eClojure"],"sub_categories":["Cloud Platforms","前端项目_其他","Firebase"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantdb%2Finstant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstantdb%2Finstant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantdb%2Finstant/lists"}