tags:

views:

1909

answers:

4
+9  Q: 

node.js database

I'm looking for a database to pair with a node.js app. I'm assuming a json/nosql db would be preferable to a relational db [I can do without any json/sql impedence mismatch]. Considering

  • couchdb
  • mongodb
  • redis

Anyone have any views / war stories re compatiability/deployability of the above with node.js ? Any clear favourites ?

+5  A: 

Redis is a popular choice. What you're after is a database driver that doesn't block.

The databases you listed are all very different. Redis takes the idea of key-value storages and runs with it, adding a variety of data types and ways of querying data. People often note that redis scales down very well too; meaning that it has very low overhead despite having the ability to perform.

Here is a list of available database modules: http://wiki.github.com/ry/node/modules#database

Jökull
+4  A: 

Although your choice very much depends on the features you are going for, I really appreciate CouchDB for it's native JavaScript environment. Both data and views are written in JavaScript so it fits very well to node.js in my opinion.

There are also different client libraries available, some are rather low level, other really very abstracted.

But as I said, you should also think about the features that you require for your database.

PartlyCloudy
+6  A: 

Hi

I'm the developer of the mongodb driver for node.js. I'm using mongodb for my own projects and have been very happy with the performance of mongodb.

Mongodb driver for node.js

(Shameless plug) Feel free to as any questions about the driver at

Google group for the mongodb driver

or here at stack overflow

Have fun with node.js. I absolutely love the platform :D

Cheers

Christian

christkv
+1  A: 

Might want to check out Persistence, high level persistance/database system for node.js.

from thechangelog.com:

Persistence is a project to allow a high level API for persisting data between process runs. The goal is to support backends that are easy to use, powerful, flexible, or all of the above if possible.

Supported databases include:

  • PostgreSQL - An enterprise level relational database. The driver is implemented in pure JavaScript and communicates over TCP using the PostgreSQL wire protocol.
  • Sqlite3 - A simple, fast, server-less relational database. This driver is a wrapper around the command-line sqlite3 program. It requires sqlite3 to be in the path. The communication is extremely fast, but types aren’t very precise. There are only strings and nulls returned.
  • MongoDB - A scalable, high-performance, open source, schema-free, document-oriented database. This driver also implements the wire protocol in JavaScript and communicated with the server over TCP.
  • JSON-DB - A homegrown system schema-free, document-oriented database that uses simple flat files containing JSON objects. This has no requirements at all except node and a filesystem. Performance is to be determined once it’s implemented fully.
Gary S. Weaver
Persistence hasn't been updated since March 2010 and is on release 0.0.4, so it seems like it might have been abandoned.
lacker