I have two same app running on different one for demo and one for developement .and m using the redis database to store key value, how can i seperate redis database for these two different app. m using node.js for redis client. and m using this https://github.com/mranney/node_redis/ redis client.
how to seperate redis database for same app in node.
You can use the
.select(db, callback)function in node_redis.If you are using expressjs, you can set a development and production environment variable to automatically set which database you are using.
Then you can make one call to
db.select()and have the options set forproductionordevelopment.More information on dev/production in expressjs: http://expressjs.com/guide.html#configuration
The
node_redis.select(db, callback)callback function will return OK in the second argument if the database is selected. An example of this can be seen on the Usage section of the node_redis readme.