Ever since the inception of JavaScript, web developers have regarded it strictly as a client side web language. All it ever helped was to make small web-based applications and impart functional features in web-pages.
Until NodeJs came into picture.
It made server-side JS coding possible. Not only did rock the world of traditional LAMP based web-development, it almost took over all other LAMP server APIs in terms of performance. NodeJS is powerful, it is flexible, and it is relatively easy to code. But for those who wanted something less complicated, simpler, not as powerful but faster, the ExpressJS framework was invented.
What is ExpressJs?
ExpressJS is a prebuilt NodeJS framework that can help you in creating server-side web applications faster and smarter. Simplicity, minimalism, flexibility, scalability are some of its characteristics and since it is made in NodeJS itself, it inherited its performance as well.
In short, ExpressJS did for NodeJS what Bootstrap did for HTML/CSS and responsive web design.
It made coding in NodeJS a piece of cake and gave programmers some additional features to extend their server-side coding. ExpressJS is hands down the most famous NodeJS framework- so much so that when most people talk about NodeJS they surely mean NodeJS+ExpressJS.
Performance of NodeJS
The first problem new programmers face when developing and launching a web app is a large number of users. If your simple PHP web app, which takes few input parameters and provide small outputs, suddenly is required to take thousands of requests, it would just collapse. NodeJS on the other hand will handle it like a boss. Thanks to Google’s V8 JavaScript engine. That’s what it is powered by.
“We are finding that people like products that just work.” – Douglas Crockford, JavaScript: The Good Parts
In addition to lightning-fast JavaScript executions, the real magic behind NodeJS is something called the Event Loop. To scale to large volumes of clients, all I/O intensive operations in NodeJS are performed asynchronously. To avoid inefficiency, NodeJS maintains an Event Loop which manages all asynchronous operations for you. When a NodeJS application needs to perform a blocking operation (I/O operations, heavy computation, etc) it sends an asynchronous task to the Event Loop, along with a callback function, and then continues to execute the rest of its program.
NodeJS is powerful in terms of performance. Now imagine combining this performance with ease of coding. Well you don’t have to imagine it because it’s already here in the form of ExpressJS.
NodeJS vs ExpressJS – Coding
Now I can go all day explaining why NodeJS is good and ExpressJS is even better. I can even elaborate in lengths the merits of ExpressJS features over NodeJS. But in the end the only important reason is ease of coding.
It is worth noting that NodeJS alone is not rocket science or anything. The only point we are trying to make here is that you can cut down your programming time in half through ExpressJS. Also since NodeJS and ExpressJS are written in JavaScript, a very easy language to learn and manipulate, the framework is highly scalable and flexible. You can build websites, web application, and even cross platform compatible mobile apps.
AngularJS and ExpressJS combo awesomeness
The combination of server-side ExpressJS and JavaScript is awesome. But you know what’s even more awesome? The combination of ExpressJS and AngularJS – a complete JavaScript paradise! You can handle your front end JavaScript coding with AngularJs framework and leave all your backend worries for ExpressJS framework. And since you are already well versed in JavaScript which is a relatively easy language to learn, you now don’t have to know so many languages for so many purposes!
The MEAN Stack
The combination of AngularJS, ExpressJS, and NodeJS may now seem to sound interesting. You have completely given up your dependency on LAMP languages, with the exception of MySQL database. But since we have been setting new trends in web based app development, why use an old database built? Let’s go for something better, something easier, robust and without the hassle of a complicated database schema language. Let’s go for MongoDB.
Let’s build a complete technology stack using latest high level programming languages and database structure namely MongoDB, ExpressJS, AngularJS, NodeJS. And this is what is more popularly known as MEAN stack. And this is where we shall be heading towards in our next article scheduled for publishing next week.