pubkey/rxdb
pubkey/rxdb has 23,422 GitHub stars and 1,182 forks. GitHot measured +3 stars in 24 hours. Last checked 2026-11-08 06:13 UTC. Last push 2026-11-03.
支持在每个 JS 运行时上运行并与现有后端进行复制的本地优先数据库——无供应商依赖,无厂商锁定——https://rxdb.info/
可以做什么
- Logging Attachments ORM Conflict Handling Middleware Signals TanStack DB - State Backup Replication Server Storages Local Documents - Schema Validation Compression Migration Encryption CRDT Population
实测星标增长
- 24小时
- +3
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文A fast, local-first, reactive Database for JavaScript Applications
What is RxDB?
RxDB (short for Reactive Database) is a local-first, NoSQL-database for JavaScript Applications. Reactive means that you can not only query the current state, but subscribe to all state changes like the result of a query or even a single field of a document. This is great for UI-based realtime applications in a way that makes it easy to develop and also has great performance benefits.
Use the quickstart, read the documentation or explore the example projects.
Used by many
RxDB is a proven technology used by thousands of developers worldwide. With its flexibility, RxDB is used in a diverse range of apps and services.
(add yours)
Multiplayer realtime applications

Replicate with your existing infrastructure
RxDB provides an easy to implement, battle-tested Sync Engine for realtime replication with your existing infrastructure.
You do not have to use a specific cloud or backend database. The protocol works by implementing three simple HTTP endpoints.
There are also production-ready plugins to easily replicate with GraphQL, CouchDB, Websocket, WebRTC (P2P), Supabase, Firestore, NATS or Google Drive.
Flexible storage layer
RxDB is based on a storage interface 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.
You can use RxDB on top of LocalStorage, IndexedDB, OPFS, LokiJS, Dexie.js, in-memory, SQLite, in a WebWorker thread and even on top of FoundationDB and DenoKV.
No matter what kind of runtime you have, as long as it runs JavaScript, it can run RxDB:
Browsers
Node.js
React Native
Capacitor
NativeScript
Flutter
or as an
Electron Database
All the features that you need
Since 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.
|
Logging Attachments ORM Conflict Handling Middleware Signals TanStack DB |
State Backup Replication Server Storages Local Documents |
Schema Validation Compression Migration Encryption CRDT Population |
Quick start
Install
npm install rxdb rxjs --save
Store data
import {
createRxDatabase
} from 'rxdb/plugins/core';
/**
* For browsers, we use the localstorage based storage.
* In other JavaScript runtimes, we can use different storages:
* @link https://rxdb.info/rx-storage.html
*/
import {
getRxStorageLocalstorage
} from 'rxdb/plugins/storage-localstorage';
// create a database
const db = await createRxDatabase({
name: 'heroesdb', // the name of the database
storage: getRxStorageLocalstorage()
});
// add collections with a schema
await db.addCollections({
heroes: {
schema: {
version: 0,
primaryKey: 'name',
type: 'object',
properties: {
name: {
type: 'string',
maxLength: 100
},
healthpoints: {
type: 'number'
}
},
required: ['name', 'healthpoints']
}
}
});
// insert a document
await db.heroes.insert({
name: 'Bob',
healthpoints: 100
});
Query data once
const aliveHeroes = await db.heroes.find({
selector: {
healthpoints: {
$gt: 0
}
}
}).exec(); // the exec() returns the result once
Observe a Query
await db.heroes.find({
selector: {
healthpoints: {
$gt: 0
}
}
})
.$ // observable with updated query results
.subscribe(aliveHeroes => console.dir(aliveHeroes));
Get started
Get started now by reading the docs or exploring the example-projects.
Support and Contribute
- Leave a Star ☝️
- Check out how you can contribute to this project.
- Read this when you have found a bug
- Buy access to the premium plugins
- Join us at discord to get help
- Follow us at LinkedIn
More content
Angular Database, Frontend Database, localStorage, React Database, Browser Database, React Native Database, PWA Database, In-memory NoSQL database, JSON database, Angular IndexedDB, React IndexedDB, Optimistic UI, local database, React Native Encryption, Vue Database, jQuery Database, Vue IndexedDB, Firestore Alternative, Firebase Realtime Database Alternative, Ionic Storage, Electron SQLite, SQLite Sync, TanStack DB Offline, DDIL Database
View llms.txt
探索相关项目
Asabeneh/30-Days-Of-Python
30 Days of Python 编程挑战是一份循序渐进的指南,用于在 30 天内学习 Python 编程语言。这项挑战可能需要超过 100 天。请按自己的节奏进行。这些视频或许也有帮助:https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,370 星标grafana/grafana
开放且可组合的可观测性与数据可视化平台。可对来自 Prometheus、Loki、Elasticsearch、InfluxDB、Postgres 等众多数据源的指标、日志和追踪进行可视化。
77,752 星标redis/redis
对于正在构建实时数据驱动应用的开发者而言,Redis 是首选、速度最快且功能最丰富的缓存、数据结构服务器和文档与向量查询引擎。
77,288 星标apache/superset
Apache Superset 是一个数据可视化与数据探索平台
75,448 星标