node-lsm

1.0.0 • Public • Published

WIP

Build Status

LSM, a log-structured-merge-tree, implemented in node.js.

var lsm = Subject('/tmp/example', {
    threshold : 1000 //optional
});
 
lsm.open().then(function(){
    return lsm.put('#12345', 'hello');
}).then(function(){
    return lsm.get('#12345');
}).then(function(result){
    console.log('result', result); // hello
});

everything is just line separated json!

cat /tmp/example/log-00000001.json

contains this.

{"key":"hello","value":"HI","type":"put"}
{"key":"what","value":"WHO","type":"put"}

put more data in there and you'll get SST files.

Features

  • PUT string key/value
  • GET string key/value
  • DEL string key/value

TODO

  • Support multiple lsm's opened pointing to the same data folder.
  • All operations promisify

Readme

Keywords

none

Package Sidebar

Install

npm i node-lsm

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

37.3 kB

Total Files

22

Last publish

Collaborators

  • parweb