Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anywhichway/clusterstore
Disk or server based clustering of objects supporting the Web Storage API
https://github.com/anywhichway/clusterstore
Last synced: about 5 hours ago
JSON representation
Disk or server based clustering of objects supporting the Web Storage API
- Host: GitHub
- URL: https://github.com/anywhichway/clusterstore
- Owner: anywhichway
- License: mit
- Created: 2017-07-29T12:26:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-30T16:34:10.000Z (over 7 years ago)
- Last Synced: 2024-10-14T09:38:40.333Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clusterstore
Disk or server based clustering of objects supporting the Web Storage API# Usage
`npm install clusterstore`
```
const ClusterStore = require("../index.js"),
// normally started as separate process on another machine
StoreServer = require("storeserver"),
BlockStore = require("blockstore"),
server = new StoreServer(new BlockStore("./test/data/remote")),
// things looking like paths with automatically create a BlockStore database
// things looking like URLs will automatically create RemoteStore connections
// alternativly, hand in pre-created instances of classes supporting an ansync version of the Web Storage API
// replicate: replicates all data to all nodes within ,
// if replicate missing, then data is sharded equally across nodes using a lexigraphic split on the last char of the keys
storage = new ClusterStore(["./test/data/data1","http://localhost:3000"],{replicate:2500,clear:false});
// listen would not be necessary if server was really remote
server.listen(3000).then(() => {
storage.set("myid",JSON.stringify({item:"test"}));
});
```# Release History (reverse chronological order)
v0.0.2 2017-07-29 ALPHA Tested with `blockstore` locally and `remotestore` served up by `storeserver`.
v0.0.1 2017-07-29 ALPHA First public release