Bindings for using LevelDB through node.
The leveldb library provides a persistent key value store. Keys and values are arbitrary byte arrays. The keys are ordered within the key value store according to a user-specified comparator function.
This project is node bindings to this excellent library so that node programs can either implement their own custom databases or simply use it directly as a fast, simple key/value store.
While implementing nStore, I realized there are a couple things that V8 and node are not very good at. They are heavy disk I/O and massive objects with either millions of keys or millions of sub objects.
Since LevelDB provides good primitives like MVCC and binary support (It was designed to back IndexDB in the Chrome browser), then it can be used as a base to implement things like CouchDB.
var leveldb = require'leveldb';leveldbopen"path/to/my/db" create_if_missing: true onOpen;var key = "mykey";dbputkey "My Value!"dbgetkeyconsoledirvalue; // prints: My Value!dbdelkey;;;
To compile native code and CoffeeScript do:
To run tests do:
You can also view the current build status on Travis-CI.
The leveldb library is bundled in the deps folder and is compiled in
staticly. The resulting node addon is about 4mb unstripped. If you want to
make it smaller, I've had success using the
strip command on it which
shrinks it down to about 300kb.
Since I am not experienced in the world of C++ and am still learning, I welcome contributions. Mainly what I need right now is someone with experience to review my code and tell me things I'm doing stupid. Maybe add a C++ best pratices note to this document.
Currently Randall Leeds (@tilgovi and one of the CouchDB commiters) has expressed interest in helping and already has commit rights to the project.
176 Michael Phan-Ba55 Nathan Landis39 Tim Caswell19 firstname.lastname@example.org email@example.com firstname.lastname@example.org Stefan Thomas9 Randall Leeds9 Carter Thaxton6 Damon Oehlman5 Hans Wennborg4 shinuza3 email@example.com Sanjay Ghemawat1 (no author)1 Paul Vorbach1 justmoon1 Gabor Cselle