In this blog post I want to describe some of the benefits for web application development of the MEAN stack as compared to its older cousin, the LAMP stack.LAMP is comprised of four parts: LINUX as server vm, Apache for the web server, MySQL for the database, and PHP/Perl/Python as the language.MEAN is comprised of four parts as well: MongoDB, express.js, angular.js and node.js. This stack functions in a manner very similar to LAMP.
About The MEAN Stack
In the MEAN stack, node.js works as a server. However it has to run on Linux. This is based on the Google V8 engine. A lot of developers have started using node.js for the many benefits to performance and utility it provides for certain use cases. One of the major advantages is its non-blocking i/o which allows it to deliver millions of concurrent requests with ease. You will find a lot of great examples on the web that use node.js. One example is that when LinkedIn started using node.js for their mobile app they were able to reduce their server count by 90% from thirty to three and still deliver results that were 20% faster.Express.js is a node application framework. It is a popular node framework that makes it easy to create an MVC-like application on the server side. It provides the option to create routes and templates as well and supports multiple template languages including Jade.MongoDB has become indispensible to many software companies working with large data sets. It is a superb NoSQL database.Finally we have Angular.js. This is not a language as much as it is a framework to create SPAs in web application development. It plays a valuable part in the MEAN stack and can be considered an extension to HTML.
Benefits of MEAN
So why are app developers choosing to develop in MEAN rather than LAMP. Here are some of the reasons why MEAN shines:
- Flexibility in deploymentNode.js can be deployed on most modern platforms that are used to develop applications. Either Linux, Windows or Mac. Another good thing is that node.js NPM which means that is allows you to list your dependencies separately. Since the build only contains your compact code, the final deployment becomes much easier.
- Enhanced performance in data retrievalSome studies show that node.js is far superior than other approaches for certain situations where there is not as much a requirement for CPU consuming tasks.
- Effective API structureUsing this approach API structures are able to communicate between server and client. There will be no mix up of the server and client application code even though they are in the same language. The separation is really good in the MEAN stack, making it one of the reasons it is better than LAMP.
The bottom line is that the MEAN stack, when appropriate, allows you to have fewer servers and faster page loading. These add up to make a strategic difference to your business model.Some areas that the MEAN stack is being used to develop cloud applications are:
- Realtime applications
- Payment processing and e-commerce
- Social media
- Applications that have atomic CRUS operations on the backend
Some areas where the MEAN stack might not be the best choice are:
- Applications which have high security requirements
- Applications which have long running tasks or high CPU demands