Book Image

Node Web Development - Second Edition

By : David Herron
Book Image

Node Web Development - Second Edition

By: David Herron

Overview of this book

Table of Contents (17 chapters)
Node Web Development Second Edition
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Storing notes with the LevelUP data store


To get started with actual databases, let's look at an extremely lightweight, small footprint database engine, LevelUP . This is a Node-friendly wrapper around the LevelDB engine developed by Google, that's normally used in web browsers for local data persistence. It is a non-indexed, NoSQL, data store originally intended for use in browsers. The Node module, LevelUP, uses the LevelDB API and supports multiple backends, including LevelDOWN which integrates the C++ LevelDB database into Node.

It does not support simultaneous access from multiple processes. Therefore, LevelUP is not useful for sharing data between multiple Node instances.

To learn more about LevelUP see https://github.com/rvagg/node-levelup.

To learn more about LevelDB see http://code.google.com/p/leveldb/.

Installing LevelUP

Installation is this simple:

$ npm install levelup leveldown

Because LevelDOWN is a native code module, npm has to compile the module during its installation, and...