Draft:RxDB
RxDB | |
---|---|
![]() | |
Other names | Reactive Database |
Original author(s) | Daniel Meyer |
Developer(s) | Daniel Meyer, Netflix, Inc., Microsoft Corp. and contributors |
Initial release | December 20, 2016[1] |
Stable release | 16.11.0[2]
/ April 16, 2025 |
Repository | github |
Written in | TypeScript |
License | Apache License[3] |
Website | rxdb |
As of | Apirl 2025 |
RxDB is an open‑source, cross-platform NoSQL database for JavaScript applications. It is designed to support real‑time data-handling, offline‑first functionality, and data synchronization across various platforms, including web browsers, mobile applications, backend systems, and desktop applications.
RxDB shares a technical foundation with Hoodie[4], an early offline-first JavaScript database system that is no longer actively maintained[5].
Main features
[edit]Reactive data handling
[edit]RxDB utilizes RxJS observables, allowing applications to subscribe to changes in documents, queries, or individual fields. This approach enables automatic user interface updates without manual polling.
Cross‑platform support
[edit]Originally developed as a wrapper around Apache CouchDB and PouchDB for browser-based storage, the RxStorage interface, introduced in version 10.0.0, allows integration with multiple storage engines:
- Browser‑based Progressive Web Apps: Supports IndexedDB, Origin Private File System[6], SQLite, and in-memory storage.
- Mobile Applications: Compatible with React Native and Flutter, utilizing SQLite for persistence.
- Backend Systems (e.g., Node.js and Deno): Supports SQLite, FoundationDB and MongoDB.
- Desktop Applications (e.g., Electron): Can use either browser-based storage options or SQLite.
Offline‑first design
[edit]RxDB prioritizes web storage to ensure application functionality without network connectivity. Synchronization plugins allow data replication with remote databases when a connection is available.
Data synchronization and conflict resolution
[edit]RxDB provides replication plugins that facilitate synchronization with backend systems, including CouchDB, GraphQL endpoints, Firestore, and NATS. It incorporates conflict resolution mechanisms, such as revision‑based detection and atomic operations, to maintain data integrity.
Extensibility and plugins
[edit]A plugin-based architecture allows developers to extend RxDB’s core functionality. Available plugins enable additional capabilities such as full‑text search, vector search, leader election for multi-tab synchronization, and conflict-free replicated data types.
Performance considerations
[edit]RxDB includes optimizations to improve efficiency:
- EventReduce algorithm: Reduces query re-execution by computing new results based on change events.[better source needed]
- Compression and indexing: Uses JSON key compression and indexing to enhance performance.
- Batched operations: Groups operations to minimize I/O overhead.
Security and schema Management
[edit]RxDB supports JSON schema validation and offers field-level encryption through plugins. It also provides schema migration capabilities to manage data consistency across application updates.
Use cases
[edit]RxDB is used in applications that require offline functionality and real-time updates. Common use cases include:
- Real‑time applications: Collaborative tools such as chat platforms and shared document editors.[7]
- Offline‑first tools: Applications that must function without constant internet access, such as field service tools and note-taking apps.[8]
- Cross-platform applications: Used in frameworks like React Native and Capacitor for unified development across platforms.
- IoT and edge computing: Supports local data management in low-latency environments.
Community and adoption
[edit]RxDB is an open-source project licensed under Apache License and is maintained on GitHub. The project is supported by contributors through GitHub and Discord.
As of February 2025, RxDB has accumulated over 22,000 GitHub stars and has been utilized in thousands of open-source projects.[9]
References
[edit]- ^ "1.5.5 (December 20, 2016)". GitHub.
- ^ "Releases - RxDB". GitHub. Retrieved 2025-04-19.
- ^ "rxdb/LICENSE". RxDB. Retrieved 2025-04-19 – via GitHub.
- ^ "Local-first database: RxDB + PouchDB | Jared Forsyth.com". jaredforsyth.com. Retrieved 2025-02-17.
- ^ hoodiehq/hoodie, Hoodie, 2025-02-14, retrieved 2025-02-17
- ^ "Origin private file system - Web APIs | MDN". developer.mozilla.org. 2024-10-16. Retrieved 2025-02-17.
- ^ Romão, João Diogo Martins (2023-10-03). "Collaborative web application for real-time monitoring of sport events". Mestrado em Engenharia Informática e Computação. University of Porto. hdl:10216/154685 – via Repositório Aberto da Universidade do Porto.
- ^ Tahir, Zulkifli; Dasmito, Al-Riefqy; Adnan; Niswar, Muhammad; Wardi (2020). "A Reliable Offline Web System for Small and Medium Industries". MATEC Web of Conferences. 331: 06007. doi:10.1051/matecconf/202033106007. ISSN 2261-236X.
- ^ "Network Dependents · pubkey/rxdb · rxdb repositories". GitHub. Retrieved 2025-02-17.