Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A fast, local first, reactive Database for JavaScript Applicationshttps://rxdb.info/

License

NotificationsYou must be signed in to change notification settings

pubkey/rxdb

Repository files navigation


JavaScript Database

A fast, local-first, reactive Database for JavaScript Applications

       

     


  What is RxDB?

RxDB (short forReactiveDatabase) is alocal-first, NoSQL-database for JavaScript Applications like Websites, hybrid Apps, Electron-Apps, Progressive Web Apps, Deno andNode.js. Reactive means that you can not only query the current state, butsubscribe to all state changes like the result of a query or even a single field of a document. This is great for UI-basedrealtime applications in a way that makes it easy to develop and also has great performance benefits but can also be used to create fast backends in Node.js.
RxDB provides an easy to implementprotocol for realtimereplication with your existing infrastructure or one of the plugins forHTTP,GraphQL,CouchDB,Websocket,WebRTC,Supabase,Firestore,NATS.
RxDB is based on a storage interface that enables you to swap out the underlying storage engine. This increasescode reuse because you can use the same database code for different JavaScript environments by just switching out the storage settings.

Use thequickstart, read thedocumentation or explore theexample projects.

  Used bymany

RxDB is a proven technology used bythousands of developers worldwide. With its flexibility, RxDB is used in a diverse range of apps and services.


(add yours)

  Multiplayer realtime applications

realtime.gif

  Replicate with yourexisting infrastructure

RxDB provides an easy to implement,battle-testedSync Engine forrealtime 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 withGraphQL,CouchDB,Websocket,WebRTC (P2P),Supabase,Firestore orNATS.

  Flexible storage layer

RxDB is based on astorage interface that enables you to swap out the underlying storage engine. This increasescode 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 ofLocalStorage,IndexedDB,OPFS,LokiJS,Dexie.js,in-memory,SQLite, in aWebWorker thread and even on top ofFoundationDB andDenoKV.

No matter what kind of runtime you have, as long as it runs JavaScript, it can run RxDB:

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
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 databaseconstdb=awaitcreateRxDatabase({name:'heroesdb',// the name of the databasestorage:getRxStorageLocalstorage()});// add collectionsawaitdb.addCollections({heroes:{schema:mySchema}});// insert a documentawaitdb.heroes.insert({name:'Bob',healthpoints:100});

Query data once

constaliveHeroes=awaitdb.heroes.find({selector:{healthpoints:{$gt:0}}}).exec();// the exec() returns the result once

Observe a Query

awaitdb.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

Get started now byreading the docs or exploring theexample-projects.

  Support and Contribute

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

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp