forked from pubkey/rxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Filesystem Node RxStorage | ||
|
||
The Filesystem Node [RxStorage](./rx-storage.md) for RxDB is built on top of the [Node.js Filesystem API](https://nodejs.org/api/fs.html). | ||
It stores data in plain json/txt files like any "normal" database does. It is a bit faster compared to the [SQLite storage](./rx-storage-sqlite.md) and its setup is less complex. | ||
Using the same database folder in parallel with multiple Node.js processes is supported when you set `multiInstance: true` while creating the [RxDatabase](./rx-database.md). | ||
|
||
**NOTICE: The Filesystem Node RxStorage is part of [RxDB Premium](https://rxdb.info/premium.html)** | ||
|
||
<p align="center"> | ||
<img src="./files/rx-storage-performance-node.png" alt="RxStorage performance - Node.js" width="700" /> | ||
</p> | ||
|
||
|
||
## Usage | ||
|
||
```ts | ||
import { | ||
createRxDatabase | ||
} from 'rxdb'; | ||
import { getRxStorageFilesystemNode } from 'rxdb-premium/plugins/storage-filesystem-node'; | ||
|
||
const myRxDatabase = await createRxDatabase({ | ||
name: 'exampledb', | ||
storage: getRxStorageFilesystemNode({ | ||
basePath: path.join(__dirname, 'my-database-folder'), | ||
/** | ||
* Set inWorker=true if you use this RxStorage | ||
* together with the WebWorker plugin. | ||
*/ | ||
inWorker: false | ||
}) | ||
}); | ||
/* ... */ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters