Why is MEAN getting so much popular?

The JavaScript community is growing strong in the last few years. MEAN is a free and open-source JavaScript software stack for building dynamic web sites and web application. The MEAN stack consist of :

  • MongoDB
  • Express.js
  • Angular.js
  • Node.js

Since every component of this stack is written in JavaScript it is easy for you to understand it and to go through your code.  Because it is all single language we can do some great things like using JavaScript on the server-side (Node and Express), using JavaScript on the client-side (Angular), store JSON objects (MongoDB) and use that objects to transfer data easily from database to server to client. Even frontend developers that work in Angular can understand with ease most of the code used on the server side.

To start with database, we will store our informations and data in JSON like format. We can also write JSON queries on our Node server and send them directly to our front-end using Angular. The simplicity of using MEAN will be more obvious when we start with some examples.

Why should you use MEAN stack?

Below are 7 reasons in my opinion why you should use MEAN stack and what are advantages :

  1. First of all, JavaScript is the language with most increase in popularity nowdays. This image below shows how popular  JavaScript is becoming.

    Figure 1. Popularity in the last few years
  2. One language to rule them all
    If you take for comparison another stack like LAMP which have PHP in your server, queries in MySQL data using SQL, and JavaScript in client side. But now, with MEAN we have just one language. Although MongoDB dont have .js suffix like others, it uses BSON format which is binary encoded version from JSON. So yeah,we could say it is all JavaScript.
  3. Great performance
    Mostly because of an asynchronous event driven JavaScript runtime, Node is designed to build scalable network applications. Node is non-blocking I/O so you will get the best of your app performance if you power it with the node.js server.

    Figure 3. Node.js architecture
  4.  Uses a NoSQL database (MongoDB) that frees you from having to micromanage migrations and schemas.
  5. Has a powerful client-side JavaScript framework (AngularJS) built in, so that you can build modern Single Page Apps. Because of Angular’s bingding data you dont need to menage DOM anymore,which is great if you ask me.
    It is the meater of the taste, some people prefer jQuery and not Angular,but my preferation is Angular so this tutorials will be in Angular.
  6. Support from community and industry.
    MongoDB is the leading NoSQL database provider. AWS and Azure, the two bigest cloud providers already support Node.js. Google support AngularJS. NPM is the largest package ecosystem ever.
  7. Last but not least important reason why you should use MEAN , because it is open-source and free. I would say it is important 🙂

Conclusion: The MEAN stack benefts mostly from the strengths of Node. Because node lets us develop real-time open APIs and use it with Angular code in frontend. Transfering data for building applications like chat systems, status and posts updates, or any other application that requires quick display of real-time data.

Why should you NOT use MEAN stack?

If MEAN stack is great for many things it doesn’t mean it is flawless and perfect for everything. Like everything mean also have some imperfections.
Node is generally not the best pick for CPU intensive tasks, but that doesn’t mean that node can’t do well in heavy applications.

Some of the big companies that uses MEAN

You can see many developers in StackOverflow that praises MEAN stack. Some large companies have already integrated Node into many of their operations.

Figure 4. Large companies that use Node.js