Contact Us

Contact Us



Pleas confirm by checkbox


ScalabilityTechnicalWeb Development

Comparing performance of node.js frameworks

Author_img
By Ratnesh Singh Parihar December 29, 2017

Our mission is to compare the node.js frameworks on performance (completed no of requests per second).

Node.js performance tests were performed on the Ubuntu subsystem(2 core , 2 GB RAM) on a VM provisioned from Digital Ocean. The tests only utilize the most basic capabilities of the frameworks in question, therefore the main goal was to show the relative overhead these frameworks add to the handling of a request. This is not a test of the absolute performance as this will vary greatly depending on the environment and network conditions. This test also doesn’t cover the utility each framework provides and how this enables complex applications to be built with them.

We are doing followings three transactions  in each request

  1. create document in db .
  2. fetch the same document from db and add new fields and update the document
  3. update the document’s three field in an audit trail document (nested array)

we are also doing mulptile logging in each transactions.

Data base is mlab data base hosted in same data center where the VM is hosted.

connection string(poolsize etc.) are same for each framework.

There are no caching involved while testing for any of the framework.

Node.js version 6.9 has been used to all three framework.

We are comparing 4 frameworks

  1. hapi+ mongoose
  2. express + mongoose
  3. nodedata
  4. native(http + mongodb driver for node.js)

We taking following scenarios for each of the framework and comparing them

  1. single small document(each document size 5 kb)
  2. single big document(document size 200 kb)
  3. 100 small documents (each document 5 kb)
  4. 100 big documents(each document 200 kb)

Results:- 
Performance node js networks
Understanding the results:-

  1. Every framework add significant overhead as compare to native calls
  2. on bigger documents (heavy load) this difference become less significant because operations on the load size negates the overhead
  3. on small documents both express and node-data outshines the hapi.
  4. for a single document(small or big) express and node-data are almost equal
  5. on multiple documents(small),node-data completely outshines both express and hapi and closer to  native
  6. on multiple documents(big size),node-data is performing 4-5 time better than  both express and hapi and closer to  native

How node-data achieve the performance improvements :-

1.in node-data we make sure that once a document is fetched from DB we don’t do any serialization/transformation over db objects and pass it to application middle wares as it is.

2.we also improve the native db driver code , so it doesn’t impose any performance penalty

3. for multiple documents creation, fetch and update , we have special bulk operations which provide a right balance to batch size and no of concurrent calls to DB.

If you want to know more about node-data check out the our github
 
https://github.com/ratneshsinghparihar/Node-Data

Or visit our main page

https://nodedataio.azurewebsites.net/

If you want to try out your self , check out this template

https://github.com/sureshdube14/nodedata-demo-sample/tree/master

For step by step creation of first node-data application follow this blog.

https://wordpress.com/post/blog.talentica.com/2596

Related posts
Data Fingerprinting to enable Incremental Improvement in Machine Learning Complexity
AI & Machine Learning

Data Fingerprinting to enable Incremental Improvement in Machine Learning Complexity

By ratneshparihar February 20, 2018
What's new in Node-Data 2.0
Scalability

What's new in Node-Data 2.0

By ratneshparihar December 30, 2017
Comparing productivity of node.js frameworks
Project Management

Comparing productivity of node.js frameworks

By ratneshparihar December 29, 2017

Stay updated

Get the latest creative news from Fubiz about art, design and pop-culture.