15

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
Synthetic Dream
  • 191
  • 1
  • 2
  • 8
  • 1
    For new projects you might want to take a look at [AceBase](https://github.com/appy-one/acebase), which is a very lightweight and fast NoSQL database engine for Node.js. Very easy to setup and use within minutes, zero config necessary. It's free, all source is open and hosted at GitHub – Ewout Stortenbeker Jan 12 '22 at 09:56

3 Answers3

17

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

Bulkan
  • 2,555
  • 1
  • 20
  • 31
  • 5
    Can you use Mongoose with NeDB since it is a subset of MongoDB? – CatDadCode Nov 04 '13 at 07:40
  • 1
    I've tried to hack it together but it's a serious effort to get Mongoose working with it. Mainly because of the mongo core packages, kerberos and bson stuff in many places. It could be done. [Camo](https://github.com/scottwrobinson/camo) is another ODM and works for mongo and nedb. – ruffrey Feb 18 '16 at 14:49
  • 4
    In mid-2019, NeDB hasn't seen a new release in over 3 years. – Coderer Jul 25 '19 at 12:49
  • 1
    If you prefer the Promise syntax rather than the callback version, take a look: https://github.com/bajankristof/nedb-promises – rodvlopes Oct 17 '20 at 18:16
  • NeDB is no longer maintained. For those looking for an alternative, have a look at [AceBase](https://github.com/appy-one/acebase) – Ewout Stortenbeker Jan 12 '22 at 10:01
0

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

-4

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/

vodolaz095
  • 6,680
  • 4
  • 27
  • 42