Why to use Node.js + express + mongoDB ?

Use Node.js + Express + MongoDB.

What is Node.js ?

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Node is a fast C++-based JavaScript interpreter with bindings to the low-level Unix APIs for working with processes, files, network sockets, etc., and also to HTTP client and server APIs.

Node.js is actually not a framework, but a runtime environment that allows to execute JavaScript on the server side. Even though it was originally written in 2009 it wasn’t widely adopted until recently.

Why we are jumping on Node.js ?
1. Asynchronous I/O

  • Asynchronous I/O is a form of input/output processing that permits other processing to continue before the transmission has finished. Except for some specially named synchronous methods, Node’s bindings are all asynchronous, and by default Node programs never block, which means that they typically scale well and handle high loads effectively. Because the APIs are asynchronous, Node relies on event handlers,which are often implemented using nested functions and closures.


2. Javascript

  • Node.js is Javascript. So the same language can be used on the back end and frontend.This means it breaks down the boundaries between front- and back-end development.


3. Event driven

  • Event driven programming is a generic concept where event emitter emits the number of events and a main loop listens to these events and immediately triggers a callback function as soon as the corresponding event is detected in that loop. In Node.js, the events are heavily used which make Node.js a pretty fast application as compared to the other similar technologies.


Why should we use MongoDB?

MongoDB provides the persistence for your application data.Mongoose allows us to have access to the MongoDB commands for CRUD simply and easily.

MongoDB is an open-source, document database designed with both scalability and developer agility in mind. MongoDB bridges the gap between key-value stores, which are fast and scalable, and relational databases, which have rich functionality. Instead of storing data in rows and columns as one would with a relational database, MongoDB stores JSON documents in collections with dynamic schemas.

Mongo + Node is extremely popular when you need a fast and convenient development cycle,performing Mongo queries in Node is, as you mentioned, straight forward, Mongo is a key value store, so basically no type checkings stuff” – what I meant here by “key value store” was that there are no predefined types for values in general. you could first have a field be a string, then you could have it be an numeral.

Why should we use Express?

Express 3.x is a light-weight web application framework to help organize your web application into an MVC architecture on the server side. You can use a variety of choices for your templating language (like EJS, Jade, and Dust.js).

The Express Generator lets you create complex applications quickly.

  1. Server-side web and mobile application framework
  2. Language: written in JavaScript
  3. Express builds: Single-page, multi-page, and hybrid mobile and web applications Common back-end functions for web applications APIs (application programming interfaces)
  4. Templating engines: Express comes with two templating engines, Jade and EJS, which facilitate the flow of data into a website structure.
  5. MVC pattern: Express supports the Model-View-Controller architecture, a really helpful way to build websites in a model-driven format.
  6. Platform: Node.js
  7. Operating system: It’s cross-platform, so it’s not limited to one OS.