kval (under construction)
A simplistic and easy to scale JSON document datastore.
- wickedly fast
- see LMDB benchmarks upon which it is built
- ACID compliant - supports transactions
- persistent
- larger-than-memory
- JSON document store
- scale to over 1 billion records
- Peering (coming soon)
- peer pub-sub
- add and remove peers
kval uses a mongoose-like API.
Datastore setup
- Node.js ^v0.12.5
- nvm is an easy option for installing and managing Node.js versions
- Terminal:
npm install -g kval
(may require elevated privileges) - Terminal:
kval start
(required elevated privileges)- a full list of options can be seen by running
kval help
- a full list of options can be seen by running
This will install the database, keep it up on server reboots. By default
it listens on 127.0.0.1:9226
.
To be accessible externally, the port will need to be opened in your firewall, and you must listen on a public IP by adding it in the config file.
To stop, do kval stop
. This will prevent it from automatically starting
when the server starts.
Config file
The database will be installed in the kval
folder of your global node_modules.
Run npm list -g
to see where node_modules are installed.
See the config file inside the installation: db-config.json
.
Example default config file:
If this looks familiar, it is a pm2 process file. The full list of options can be seen in the pm2 app declaration docs.
Node.js client usage
Connecting
var Kval = Client;var kval = ; kval;
Creating and updating
var schema = properties: name: type: 'string' index: true // makes it searchable, non-indexed fields are not age: type: 'number' libraryCard: type: 'string' unique: true // makes it searchable and ensures uniqueness ; var User = client;var user = name: 'Bill' age: 32 libraryCard: 'A-55555' ; console; // auto generated id field user;
Finding
User;User;
Deleting
User;
Other languages
Drivers for other languages have not been added yet. Please open an issue if you are interested in support for a language other than Node, or if you created one and would like us to list it here.