node-level
v0.2.4
Published
Downloads
4
Readme
node-level
A pure node.js implementation of LSM(log structured merge tree) based storage engine(inspired by leveldb).
Get started
Use in JavaScript or TypeScript:
const path = require('path')
const { Database } = require('node-level') // install from npm
async function main(){
const db = new Database(path.resolve(__dirname, './db'))
await db.put('foo', 'bar')
console.log(
(await db.get('foo')).toString()
) // 'bar'
}
main()
For more details, see documention
Roadmap
- [x] TableBuilder
- [x] TableReader
- [x] TableCache
- [x] LogWriter
- [x] LogReader
- [x] WriteBatch
- [x] MemTable
- [x] Database Recovery
- [x] Version Manager
- [x] Compaction
- [x] Top-level API (put, get, del, batch, iterator, compactRange, ok)
Benchmark
environment : GitHub Action
key : 16 bytes
value : 100 bytes
total : 10000
runners : 10
fillrandom : 1154.48 ms total; 115.45 us/op