Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best database for Node.js app using websockets

I am learning Node.js and the simple app I am creating will store 3 values in a database: latitude, longitude, message.

The app will then pull out any message that is located within a certain distance from your current location. The websockets just keeps your location up to date if you move around.

I know how I would do this using MySQL, but I thought there might be a more appropriate database that works well with Node.js.

Any suggestions?

like image 639
Tom Avatar asked Mar 10 '11 17:03

Tom


2 Answers

Any key-value store is perfect for node.js since they store data as native JS objects or JSON.

Some popular ones include:

  • MongoDB
  • Redis
  • Couch
  • Riak

Here's a list of database modules for node.js: https://github.com/joyent/node/wiki/modules#database

like image 117
swalk Avatar answered Oct 02 '22 13:10

swalk


Check out GeoCouch:

http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-the-future-is-now%3A2010-05-03%3Aen%2CCouchDB%2CPython%2CErlang%2Cgeo

It lets you do spatial queries with CouchDB. It is very easy to talk to CouchDB from node.js because the API is JSON over HTTP.

like image 29
Matt Ranney Avatar answered Oct 02 '22 13:10

Matt Ranney