How to Load test with Node JS and Mongo DB - node.js

How to Load test with NodeJS and MongoDB using Jmeter?
We need to Evaluate NodeJS and Mongo Db Performance?

As like any web application you can loadtest NodeJS application via web services or URLs.
You can use Jmeter Test Script recorder to record all requests and services of NodeJS app. If you need java script specific you can use phanos or Loadtest.
To load test mongo DB, since jmeter 2.9 there is a MongoDB sampler.

Related

In memory redis server for test

I am writing integration tests for my NodeJS application that connects to a Redis cluster. The test framework I use is Mocha. Is it possible to setup Redis as an in-memory database which I can use to only test which then wipes away all my keys when the test is done?
Check this out
https://github.com/mhassan1/redis-memory-server : Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.

In memory database that can be used during testing Nodejs Express App

I want to use an in-memory database only while running unit test cases for express APIs.
For Instance in Java Spring we use H2 Database for testing and in main we used mysql.
So any recommendations on the same.
Also how I change the package.json so that while running mocha node will automatically catch that inmemory database for storing values.
Like in Spring we would application.properties in test folder and then spring would automatically fetch the test db settings.

Knex js opening multiple inactive sessions for a given user in oracle db

I am working on a web application with knex js along with oracle DB on a sails js platform. In my project, I have the limitation that only 10 session users can be opened simultaneously irrespective of them being active or not.
While working on knex js with oracle DB, I found that knex js open up many inactive sessions for the same user on my AWS RDS instance. Screenshot attached below.
Due to this my API written on the sails js framework breaks with the following error
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
My question is that is there a way to reduce or remove the invalid sessions and make the session limit to 10 in knex js.
Note:
My node version is 6.10.0. Also, my oracle database is on 11g and my sails js version is 0.12.9.

couchdb and node.js application deployment

I am new to couchdb and node.js. In my application I will need some server side logic and a rest api for storing and querying json documents and attachments in couchdb. Moreover, the application will provide a web console using angularjs for managing data.
What would be the best scenario for this application. Following options come to mind:
putting node.js with express in front of couchdb and serve the rest api and the console from node.js
putting couchdb in front, serving the console from couchdb as a couchapp and redirecting the rest requests through couchdb to node.js
running couchdb and node.js in parallel behind nginx reverse proxy serving the rest api from node.js and the application from couchdb
running couchdb and node.js in parallel behind nginx reverse proxy serving the rest api and the console from node.js but relaying db queries directly to couchdb
serving the console directly from nginx, relaying rest requests to node.js and db queryies to couchdb
running node.js and couchdb in parallel serving the console from either couchdb or node.js and the rest api from node.js without any reverse proxy in front of it
etc. etc.
Moreover, a general question arises:
* is it advisable to put either node.js or couchdb directly to the edge without any reverse proxy or other "wall" in front of it?
Many thanks for expert input in advance!

share mongodb between nodejs and meteor

I just finished a REST server application in nodejs using express, passport and mongodb
I want to create a meteor app for the LIVE Statistics of that mongodb REST api's , like number of connections, user online etc.
But I can't figure out a way to use custom mongodb with meteor. Basically I want to share the same database with nodejs/express application and meteor.
Is it possible? I am sure it should be, but I can't figure out HOW!
Help please!
Okay, I got here what to do.
While deploying meteor, they have an option to choose the database.
So i created an app on meteor and then deployed it for nodejs
here is how,
meteor bundle myapp.tgz
extracted myapp.tgz and used the command below.
PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js
Here is complete doc : http://docs.meteor.com/#deploying

Resources