Our mission is to compare the node.js frameworks on productivity.
In one of my previous blogs I have benchmark the various node.js frameworks performance against native http call and native mongodb driver and native combination was clear winner in term of performance.
https://blog.talentica.com/2017/11/14/comparing-performance-of-node-js-frameworks/
so, Why not use only native http and native mongodb driver. well one of the the key aspect and usp of node.js frameworks is that they provide lot of abstractions and as a developer you don’t have to write boiler plate , repetitive code . so lets see what our research has come up with against this concept.
as contrast to last time we will start with result first Now before Analyzing the result its important to put the benchmark methodologies into the plate . we are taking three factors into account when its comes to productivity
- lines of code
- testing hours involved to stabilize the system
- complexity (relations , security,etc.)
for our research we are building a blog authoring /publishing site like worpress, we are taking four features in order of their complexities
- api create blogs
- api to create comments inside blogs (relations
- api to upvote comment , blogs and upvote on comments automatically upvote the blog
- security in all of above apis
below is data points for an application built using express and mongoose.
native http + native mongo Driverwe did same thing for the following frameworks
express+moongoose
koa+mongoose
hapi+mongoose
Node-Data
in our chart thats how we have got out man-hours for each of framework as the complexity increases in yaxis( for more complexity we increase the no of features).
lets understand the results in the chart
- abstraction or less no of line of code is not the real driving factor for frameworks , its the complexities , the more complex the system is it will require more code changes and more testing in development (LOC might get reduce actually).
- it will take massive amount of time to build a complex system using native http and native monogodrive (you have to do lot of coding here and frameworks provide very nice apis)
- at low complexities all frameworks are equal
- Hapi has very nice apis and allow lot of configuration and again their configuration allow less time focusing on testing complexity.
- Hapi has clear edge over other two famous frameworks (express and koa)
- node-data creates rest end point automatically so lot of effort get saved.
- like hapi has configuration , node-data is all about convention using AOP, using attributes or decorators , like for creating comments inside blogs you can straight away put @onetomany attribute while declaring your blog model and it does rest
- for security node-data has attributes , which automatically secure the end points and traffic over these end points .
Conclusion
if you are building node.js application and expecting lot of features and expecting complexities , you should pick one of the frameworks instead of using native http or native drivers , we have put lot of effort to increase developer productivity and ability to handle complex situations .. If you want to know more check out the our github
https://github.com/ratneshsinghparihar/Node-Data
Or visit our main page