Question

What is the best embedded NoSQL database for Node.js?

My node.js application is too tiny to use a big database like mongodb which need extra configurations.

I tried EJDB, but it need too much disk space (about 1.5MB for each record).

I also search the web, but google gave me so many choices, which made me so confused.

Here are some requirements:

  • fast and lightweight
  • no need too much config
  • be able to store large amount of data (about hundred thousand records, total size in 1GB)
  • better package for Node.js
Was it helpful?

Solution

The most popular embedded Node.js database on GitHub is NeDB

OTHER TIPS

Check this one: https://www.npmjs.com/package/ultradb
* no need for configuration, just point database file
* written for node in C, uses native node API - NAPI
* ideal for storing logs, large number of documents
* not ideal if you need to query over documents properties - you'll have to handle all kind of indexing yourself
* works as part of node, no separate processes
* multicore processors friendly - scales with node processes, multiple node instances/forks can work simultaneously on same database
* about 300kB

Maybe redis with storing documents as hashes? http://redis.io/commands#hash

It works perfectly on Rapsberry Pi with about 100 hits per minute.

Also there is a good ORM for it - http://jugglingdb.co/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top