Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs and database communication - how?

Tags:

I've heard much good about nodejs and writting client-server application with it. But I can't get, for example, when developing IM client-server application, how nodejs server script is supposed to talk to database server to actually store it's data? Or may be I miss something and nodejs server scripts are not supposed to do that? If so, please, push me to correct direction.

I've noticed DBSLayer http://code.nytimes.com/projects/dbslayer/wiki, but it looks like it's still in beta.

like image 678
Vladislav Rastrusny Avatar asked May 29 '10 11:05

Vladislav Rastrusny


People also ask

CAN node js interact with database?

Node. js can be used in database applications. One of the most popular databases is MySQL.

Can Nodejs communicate with SQL?

You can connect to a SQL Database using Node. js on Windows, Linux, or macOS.

How do node js databases work?

To access the database from Node. js, you first need to install drivers for the database you want to use. The following table lists important relational databases and respective drivers. The following table lists important NoSQL databases and respective drives .


1 Answers

You need to grab a module that handles the communication to the database you want. See here for a list of modules for node.js. Popular databases that work well with node.js are MongoDB, CouchDB and Redis.

like image 57
stagas Avatar answered Sep 22 '22 23:09

stagas