{"id":4687,"url":"https://github.com/pubkey/rxdb","last_synced_at":"2026-03-15T19:58:30.122Z","repository":{"id":36963353,"uuid":"75425073","full_name":"pubkey/rxdb","owner":"pubkey","description":"A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/","archived":false,"fork":false,"pushed_at":"2025-04-23T19:01:09.000Z","size":429668,"stargazers_count":22267,"open_issues_count":11,"forks_count":1116,"subscribers_count":206,"default_branch":"master","last_synced_at":"2025-04-23T22:44:07.277Z","etag":null,"topics":["angular","browser-database","couchdb","crdt","database","firebase","graphql","indexeddb","ionic","local-first","localstorage","nodejs","nosql","pouchdb","react-native","realtime","realtime-database","rxdb","rxjs","sqlite"],"latest_commit_sha":null,"homepage":"https://rxdb.info/","language":"TypeScript","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/pubkey.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"pubkey","custom":["https://rxdb.info/premium/","https://rxdb.info/consulting/"]}},"created_at":"2016-12-02T19:34:42.000Z","updated_at":"2025-04-23T21:50:49.000Z","dependencies_parsed_at":"2023-09-22T03:57:38.689Z","dependency_job_id":"263fb380-53e3-4fcc-86be-75786bd4aa8c","html_url":"https://github.com/pubkey/rxdb","commit_stats":{"total_commits":10900,"total_committers":243,"mean_commits":44.8559670781893,"dds":0.5330275229357798,"last_synced_commit":"941275e876de793e76cc7dc605b301351edf0525"},"previous_names":[],"tags_count":496,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubkey%2Frxdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubkey%2Frxdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubkey%2Frxdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubkey%2Frxdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pubkey","download_url":"https://codeload.github.com/pubkey/rxdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528694,"owners_count":21445511,"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":["angular","browser-database","couchdb","crdt","database","firebase","graphql","indexeddb","ionic","local-first","localstorage","nodejs","nosql","pouchdb","react-native","realtime","realtime-database","rxdb","rxjs","sqlite"],"created_at":"2024-01-05T20:17:20.300Z","updated_at":"2026-03-15T19:58:30.104Z","avatar_url":"https://github.com/pubkey.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rxdb.info/\"\u003e\n    \u003cimg src=\"./docs-src/static/files/logo/logo_text.svg\" width=\"380px\" alt=\"JavaScript Database\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ch3 align=\"center\"\u003eA fast, \u003ca href=\"https://rxdb.info/articles/local-first-future.html\"\u003elocal-first\u003c/a\u003e, reactive Database for JavaScript Applications\u003c/h3\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/pubkey/rxdb/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/pubkey/rxdb?color=%23ff00a0\u0026include_prereleases\u0026label=version\u0026sort=semver\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://rxdb.info/tutorials/typescript.html\"\u003e\u003cimg src=\"https://img.shields.io/npm/types/rxdb?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/pubkey/rxdb/blob/master/LICENSE.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/pubkey/rxdb?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/pubkey/rxdb/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/pubkey/rxdb?color=f6f8fa\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://www.npmjs.com/package/rxdb\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/rxdb?color=c63a3b\u0026style=flat-square\"\u003e\u003c/a\u003e   \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n \t  \u003ca href=\"https://rxdb.info/chat\"\u003e\u003cimg src=\"https://img.shields.io/discord/969553741705539624?label=discord\u0026style=flat-square\u0026color=5a66f6\"\u003e\u003c/a\u003e\n\t  \u0026nbsp;\n    \u003ca href=\"https://twitter.com/intent/follow?screen_name=rxdbjs\"\u003e\u003cimg src=\"https://img.shields.io/badge/twitter-%40rxdbjs-1DA1F2?style=flat-square\"\u003e\u003c/a\u003e\n\t  \u0026nbsp;\n    \u003ca href=\"https://www.linkedin.com/company/rxdb\"\u003e\u003cimg src=\"https://img.shields.io/badge/linkedin-%40rxdb-0e76a8?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://rxdb.info/newsletter\"\u003e\u003cimg src=\"https://img.shields.io/badge/newsletter-subscribe-e05b29?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cbr /\u003e\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/logo/logo.svg\"\u003e\u0026nbsp;\u0026nbsp;What is RxDB?\n\u003c/h2\u003e\n\n\u003cp align=\"justify\"\u003e\n  RxDB (short for \u003cb\u003eR\u003c/b\u003eeactive \u003cb\u003eD\u003c/b\u003eata\u003cb\u003eb\u003c/b\u003ease) is a \u003ca href=\"https://rxdb.info/articles/local-first-future.html\"\u003elocal-first\u003c/a\u003e, NoSQL-database for JavaScript Applications.\n  Reactive means that you can not only query the current state, but \u003cb\u003esubscribe\u003c/b\u003e to all state changes like the result of a query or even a single field of a document.\n  This is great for UI-based \u003cb\u003erealtime\u003c/b\u003e applications in a way that makes it easy to develop and also has great performance benefits.\n\u003c/p\u003e\n\nUse the [quickstart](https://rxdb.info/quickstart.html), read the [documentation](https://rxdb.info/install.html) or explore the [example projects](https://github.com/pubkey/rxdb/tree/master/examples).\n\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/people.svg\"\u003e\u0026nbsp;\u0026nbsp;Used by \u003cb style=\"color: #e6008d;\"\u003emany\u003c/b\u003e\n\u003c/h2\u003e\n\nRxDB is a proven technology used by [thousands of developers](https://github.com/pubkey/rxdb/network/dependents) worldwide. With its flexibility, RxDB is used in a diverse range of apps and services.\n\n\u003ca href=\"https://rxdb.info/#reviews\" target=\"_blank\"\u003e\n\u003cimg src=\"./docs-src/static/files/used-by-many.png\" /\u003e\n\u003c/a\u003e\n\u003cbr /\u003e\n(\u003ca href=\"https://forms.gle/7taae27VqLXqd4sF6\"\u003eadd yours\u003c/a\u003e)\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/multiplayer.svg\"\u003e\u0026nbsp;\u0026nbsp;Multiplayer realtime applications\n  \u003cimg height=\"36\" src=\"./docs-src/static/files/icons/with-gradient/text/made-easy.svg\"\u003e\n\u003c/h2\u003e\n\n\n\n![realtime.gif](docs-src/static/files/animations/realtime.gif)\n\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/replication.svg\"\u003e\u0026nbsp;\u0026nbsp;Replicate with your \u003cb style=\"color: #e6008d;\"\u003eexisting infrastructure\u003c/b\u003e\n\u003c/h2\u003e\n\nRxDB provides an easy to implement, \u003cb\u003ebattle-tested\u003c/b\u003e \u003ca href=\"https://rxdb.info/replication.html\"\u003eSync Engine\u003c/a\u003e for \u003ca href=\"https://rxdb.info/articles/realtime-database.html\"\u003erealtime\u003c/a\u003e replication with your existing infrastructure.\u003cbr /\u003e\nYou do not have to use a specific cloud or backend database. The protocol works by implementing three simple HTTP endpoints.\nThere are also production-ready plugins to easily replicate with \u003ca href=\"https://rxdb.info/replication-graphql.html\"\u003eGraphQL\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-couchdb.html\"\u003eCouchDB\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-websocket.html\"\u003eWebsocket\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-webrtc.html\"\u003eWebRTC (P2P)\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-supabase.html\"\u003eSupabase\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-firestore.html\"\u003eFirestore\u003c/a\u003e, \u003ca href=\"https://rxdb.info/replication-nats.html\"\u003eNATS\u003c/a\u003e or \u003ca href=\"https://rxdb.info/replication-google-drive.html\"\u003eGoogle Drive\u003c/a\u003e.\n\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/storage-layer.svg\"\u003e\u0026nbsp;\u0026nbsp;\u003cb style=\"color: #8D2089;\"\u003eFlexible\u003c/b\u003e storage layer\n\u003c/h2\u003e\n\nRxDB is based on a [storage interface](https://rxdb.info/rx-storage.html) that enables you to swap out the underlying storage engine. This increases **code reuse** because the same database code can be used in different JavaScript environments by just switching out the storage settings.\n\nYou can use RxDB on top of [LocalStorage](https://rxdb.info/rx-storage-localstorage.html), [IndexedDB](https://rxdb.info/rx-storage-indexeddb.html), [OPFS](https://rxdb.info/rx-storage-opfs.html), [LokiJS](https://rxdb.info/rx-storage-lokijs.html), [Dexie.js](https://rxdb.info/rx-storage-dexie.html), [in-memory](https://rxdb.info/rx-storage-memory.html), [SQLite](https://rxdb.info/rx-storage-sqlite.html), in a [WebWorker](https://rxdb.info/rx-storage-worker.html) thread and even on top of [FoundationDB](https://rxdb.info/rx-storage-foundationdb.html) and [DenoKV](https://rxdb.info/rx-storage-denokv.html).\n\nNo matter what kind of runtime you have, as long as it runs JavaScript, it can run RxDB:\n\n\u003ch4\u003e\n  \u003cimg height=\"13\" src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/chrome/chrome_24x24.png\" /\u003e\n  \u003cimg height=\"13\" src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/firefox/firefox_24x24.png\" /\u003e\n  \u003cimg height=\"13\" src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/safari/safari_24x24.png\" /\u003e\n  \u003cimg height=\"13\" src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/edge/edge_24x24.png\" /\u003e\n  \u003ca href=\"./examples/angular\"\u003eBrowsers\u003c/a\u003e\n  \u003cimg height=\"13\" src=\"docs-src/static/files/icons/nodejs.svg\" /\u003e\n  \u003ca href=\"./examples/node\"\u003eNode.js\u003c/a\u003e\n  \u003cimg height=\"13\" src=\"docs-src/static/files/icons/react.svg\" /\u003e\n  \u003ca href=\"https://rxdb.info/react-native-database.html\"\u003eReact Native\u003c/a\u003e\n  \u003cimg height=\"13\" src=\"docs-src/static/files/icons/capacitor.svg\" /\u003e\n  \u003ca href=\"https://rxdb.info/capacitor-database.html\"\u003eCapacitor\u003c/a\u003e\n  \u003cimg height=\"13\" src=\"docs-src/static/files/icons/nativescript.svg\" /\u003e\n  \u003ca href=\"https://github.com/herefishyfish/rxdb-nativescript\"\u003eNativeScript\u003c/a\u003e\n  \u003cimg height=\"13\" src=\"docs-src/static/files/icons/flutter.svg\" /\u003e\n  \u003ca href=\"./examples/flutter\"\u003eFlutter\u003c/a\u003e\n  or as an \u003cimg height=\"13\" src=\"docs-src/static/files/icons/electron.svg\" /\u003e\n  \u003ca href=\"https://rxdb.info/electron-database.html\"\u003eElectron Database\u003c/a\u003e\n\u003c/h4\u003e\n\n\n\u003ch2\u003e\n  All the features that you need\n\u003c/h2\u003e\n\nSince its beginning in 2018, RxDB has gained a huge set of features and plugins which makes it a flexible full solution regardless of which type of application you are building. Every feature that you need now or might need in the future is already there.\n\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://rxdb.info/logger.html\"\u003eLogging\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/rx-attachment.html\"\u003eAttachments\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/orm.html\"\u003eORM\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/transactions-conflicts-revisions.html\"\u003eConflict Handling\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/middleware.html\"\u003eMiddleware\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/reactivity.html\"\u003eSignals\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://rxdb.info/rx-state.html\"\u003eState\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/backup.html\"\u003eBackup\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/replication.html\"\u003eReplication\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/rx-server.html\"\u003eServer\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/rx-storage.html\"\u003eStorages\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/rx-local-document.html\"\u003eLocal Documents\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://rxdb.info/schema-validation.html\"\u003eSchema Validation\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/key-compression.html\"\u003eCompression\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/migration-schema.html\"\u003eMigration\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/encryption.html\"\u003eEncryption\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/crdt.html\"\u003eCRDT\u003c/a\u003e\u003cbr\u003e\n      \u003ca href=\"https://rxdb.info/population.html\"\u003ePopulation\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/rocket.svg\"\u003e\u0026nbsp;\u0026nbsp;Quick start\n\u003c/h2\u003e\n\n\n#### Install\n\n```sh\nnpm install rxdb rxjs --save\n```\n\n#### Store data\n\n```javascript\nimport { \n  createRxDatabase\n} from 'rxdb/plugins/core';\n\n/**\n * For browsers, we use the localstorage based storage.\n * In other JavaScript runtimes, we can use different storages:\n * @link https://rxdb.info/rx-storage.html\n */\nimport { getRxStorageLocalstorage } from 'rxdb/plugins/storage-localstorage';\n\n// create a database\nconst db = await createRxDatabase({\n    name: 'heroesdb', // the name of the database\n    storage: getRxStorageLocalstorage()\n});\n\n// add collections with a schema\nawait db.addCollections({\n  heroes: {\n    schema: {\n      version: 0,\n      primaryKey: 'name',\n      type: 'object',\n      properties: {\n        name: {\n          type: 'string',\n          maxLength: 100\n        },\n        healthpoints: {\n          type: 'number'\n        }\n      },\n      required: ['name', 'healthpoints']\n    }\n  }\n});\n\n// insert a document\nawait db.heroes.insert({\n  name: 'Bob',\n  healthpoints: 100\n});\n```\n\n#### Query data once\n```javascript\nconst aliveHeroes = await db.heroes.find({\n  selector: {\n    healthpoints: {\n      $gt: 0\n    }\n  }\n}).exec(); // the exec() returns the result once\n```\n\n#### Observe a Query\n```javascript\nawait db.heroes.find({\n  selector: {\n    healthpoints: {\n      $gt: 0\n    }\n  }\n})\n.$ // the $ returns an observable that emits each time the result set of the query changes\n.subscribe(aliveHeroes =\u003e console.dir(aliveHeroes));\n```\n\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/rocket.svg\"\u003e\u0026nbsp;\u0026nbsp;Get started\n\u003c/h2\u003e\n\n\nGet started now by [reading the docs](https://rxdb.info/quickstart.html) or exploring the [example-projects](./examples).\n\n\u003ch2\u003e\n  \u003cimg height=\"16\" width=\"16\" src=\"./docs-src/static/files/icons/with-gradient/contribute.svg\"\u003e\u0026nbsp;\u0026nbsp;Support and Contribute\n\u003c/h2\u003e\n\n- **Leave a Star ☝️**\n- [Check out how you can contribute to this project](https://rxdb.info/contribution.html).\n- [Read this when you have found a bug](./orga/bug-checklist.md)\n- [Buy access to the premium plugins](https://rxdb.info/premium/)\n- [Join us at discord to get help](https://rxdb.info/chat)\n- [Follow us at LinkedIn](https://www.linkedin.com/company/rxdb/)\n\n\u003c!-- \n  There are many websites that just exact-copy the readme of github projects.\n  This generates free backlinks so we add some links here to pages\n  that we need to rank better.\n--\u003e\n\n#### More content\n[Angular Database](https://rxdb.info/articles/angular-database.html), [Frontend Database](https://rxdb.info/articles/frontend-database.html), [localStorage](https://rxdb.info/articles/localstorage.html), [React Database](https://rxdb.info/articles/react-database.html), [Browser Database](https://rxdb.info/articles/browser-database.html), [React Native Database](https://rxdb.info/react-native-database.html), [PWA Database](https://rxdb.info/articles/progressive-web-app-database.html), [In-memory NoSQL database](https://rxdb.info/articles/in-memory-nosql-database.html), [JSON database](https://rxdb.info/articles/json-database.html), [Angular IndexedDB](https://rxdb.info/articles/angular-indexeddb.html), [React IndexedDB](https://rxdb.info/articles/react-indexeddb.html), [Optimistic UI](https://rxdb.info/articles/optimistic-ui.html), [local database](https://rxdb.info/articles/local-database.html), [React Native Encryption](https://rxdb.info/articles/react-native-encryption.html), [Vue Database](https://rxdb.info/articles/vue-database.html), [jQuery Database](https://rxdb.info/articles/jquery-database.html), [Vue IndexedDB](https://rxdb.info/articles/vue-indexeddb.html), [Firestore Alternative](https://rxdb.info/articles/firestore-alternative.html), [Firebase Realtime Database Alternative](https://rxdb.info/articles/firebase-realtime-database-alternative.html), [Ionic Storage](https://rxdb.info/articles/ionic-storage.html)\n\n----------------\n\nView [llms.txt](https://rxdb.info/llms.txt)\n","funding_links":["https://github.com/sponsors/pubkey","https://rxdb.info/premium/","https://rxdb.info/consulting/"],"categories":["Components","Tools","Uncategorized","Packages","GraphQL Tool, Libraries, and Frameworks","JavaScript Tools, Libraries, and Frameworks","React Tools and Frameworks","TypeScript","前端常用","database","Databases","replication","Typescript / Javascript","JavaScript","三、开发者必备工具","Library","Projects using `@faker-js/faker`","HarmonyOS","Client Side","前端开发框架及项目","Store","Programming Languages","State Management","React [🔝](#readme)","Electron Tools, Libraries, and Frameworks","angular","目录","firebase","📖 Categories"],"sub_categories":["Storage","Slides","Uncategorized","Databases","Objective-C Tools, Libraries, and Frameworks","Mesh networks","3. 数据存储","Database","Storage / Database","Windows Manager","其他_文本生成、文本对话","Web DB","JavaScript","JavaScript Libraries for Machine Learning","For Electron","State Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubkey%2Frxdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpubkey%2Frxdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubkey%2Frxdb/lists"}