README.md
Use the quickstart, read the documentation or explore the example projects.
<h2> Used by <b style="color: #e6008d;">many</b> </h2>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.
<a href="https://rxdb.info/#reviews" target="_blank"> </a>(<a href="https://forms.gle/7taae27VqLXqd4sF6">add yours</a>)
<h2> Multiplayer realtime applications </h2> <h2> Replicate with your <b style="color: #e6008d;">existing infrastructure</b> </h2>RxDB provides an easy to implement, <b>battle-tested</b> <a href="https://rxdb.info/replication.html">Sync Engine</a> for <a href="https://rxdb.info/articles/realtime-database.html">realtime</a> 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 <a href="https://rxdb.info/replication-graphql.html">GraphQL</a>, <a href="https://rxdb.info/replication-couchdb.html">CouchDB</a>, <a href="https://rxdb.info/replication-websocket.html">Websocket</a>, <a href="https://rxdb.info/replication-webrtc.html">WebRTC (P2P)</a>, <a href="https://rxdb.info/replication-supabase.html">Supabase</a>, <a href="https://rxdb.info/replication-firestore.html">Firestore</a>, <a href="https://rxdb.info/replication-nats.html">NATS</a> or <a href="https://rxdb.info/replication-google-drive.html">Google Drive</a>.
<h2> <b style="color: #8D2089;">Flexible</b> storage layer </h2>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:
<h4><a href="./examples/angular">Browsers</a>
<a href="./examples/node">Node.js</a>
<a href="https://rxdb.info/react-native-database.html">React Native</a>
<a href="https://rxdb.info/capacitor-database.html">Capacitor</a>
<a href="https://github.com/herefishyfish/rxdb-nativescript">NativeScript</a>
<a href="./examples/flutter">Flutter</a> or as an <a href="https://rxdb.info/electron-database.html">Electron Database</a>
</h4> <h2> All the features that you need </h2>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.
<table> <tr> <td> <a href="https://rxdb.info/logger.html">Logging</a> <a href="https://rxdb.info/rx-attachment.html">Attachments</a>
<a href="https://rxdb.info/orm.html">ORM</a>
<a href="https://rxdb.info/transactions-conflicts-revisions.html">Conflict Handling</a>
<a href="https://rxdb.info/middleware.html">Middleware</a>
<a href="https://rxdb.info/reactivity.html">Signals</a>
</td>
<td>
<a href="https://rxdb.info/rx-state.html">State</a>
<a href="https://rxdb.info/backup.html">Backup</a>
<a href="https://rxdb.info/replication.html">Replication</a>
<a href="https://rxdb.info/rx-server.html">Server</a>
<a href="https://rxdb.info/rx-storage.html">Storages</a>
<a href="https://rxdb.info/rx-local-document.html">Local Documents</a>
</td>
<td>
<a href="https://rxdb.info/schema-validation.html">Schema Validation</a>
<a href="https://rxdb.info/key-compression.html">Compression</a>
<a href="https://rxdb.info/migration-schema.html">Migration</a>
<a href="https://rxdb.info/encryption.html">Encryption</a>
<a href="https://rxdb.info/crdt.html">CRDT</a>
<a href="https://rxdb.info/population.html">Population</a>
</td>
npm install rxdb rxjs --save
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
});
const aliveHeroes = await db.heroes.find({
selector: {
healthpoints: {
$gt: 0
}
}
}).exec(); // the exec() returns the result once
await db.heroes.find({
selector: {
healthpoints: {
$gt: 0
}
}
})
.$ // the $ returns an observable that emits each time the result set of the query changes
.subscribe(aliveHeroes => console.dir(aliveHeroes));
Get started now by reading the docs or exploring the example-projects.
<h2> Support and Contribute </h2>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
View llms.txt