As we all know, LAMP stands for Linux, Apache, MySQL and PHP/Python. It has been popular for a long time, which means there are tons of tutorials and stack overflow posts that you can reference if you get stuck. Even the worst hosting services generally support it.It has time-tested tools like PHP Admin and powerful CMS tools like WordPress and Drupal. By combining a Web server (Apache), dynamic components (using Perl, Python or PHP), and a database (MySQL) you can create a truly database-driven and dynamic Web site that is easy to update and provides rich functionality to support users.
MEAN stands for MongoDB, ExpressJS, AngularJS, and Node.js. Here, Linux operating system is replaced with any operating system that Node.js can run on. This includes MS Windows, Mac OS, and Linux.
The Apache web server is replaced with the Node.js.
The MySQL is replaced with MongoDB, which is a No-SQL database that frees you from having to micromanage migrations and schemas.
The PHP server side programming language is replaced with the ExpressJS, which basically provides a thin layer of features over Node.js.
Why MEAN took my heart away..
Below I have listed the primary reasons to choose MEAN over LAMP.
MongoDB is built for the cloud
This modern database comes equipped with automatic sharding and full cluster support, right out of the box. Plug in MongoDB and it spreads across your cluster of servers to offer failover support and automatic replication. Given the ease with which apps can be developed, tested, and hosted in the cloud, there’s little reason not to consider MongoDB for your next project.
MySQL’s structure is confining
Like all relational databases, MySQL forces you to push your data into tables. This isn’t a problem if every single entry fits into exactly the same format, but what if two people share the same address but not the same account? What if you want to have three lines to the address instead of two? MongoDB, on the other hand, offers a document structure that is far more flexible.
Node.js simplifies the server layer
MEAN makes code isomorphic
AngularJS and MongoDB both speak JSON, as do Node.js and Express.js. The data flows neatly among all the layers without rewriting or reformatting. MySQL’s native format for answering queries is, well, all its own. Yes, PHP already has the code to import MySQL data and make it easy to process in PHP, but that doesn’t help the client layer. This may be a bit minor to seasoned LAMP veterans because there are so many well-tested libraries that convert the data easily, but it all seems a bit inefficient and confusing. MEAN uses the same JSON format for data everywhere, which makes it simpler and saves time reformatting as it passes through each layer.
Node.js is superfast
Apache was great, but these days, Node.js is often flat-out faster. A number of benchmarks show that Node.js offers better performance, while doing much more.
AngularJS is fresh
It’s not exactly fair to compare the “A” in “MEAN” with anything in the LAMP stack because LAMP doesn’t include an analog. If you want to do anything on the client side, you’re on your own. Sure, there are plenty of good PHP-based frameworks that work with MySQL, but each is a bit different and moving in its own direction. WordPress, Joomla, and Drupal, for example, offer differing strategies, and it’s hard to switch between them, let alone port code from one to the other. Anointing one client framework adds consistency and stability.
Of course, if you’re really picky, there’s no reason why you can’t mix it up a bit. Plenty of developers use MongoDB with Apache and PHP, and others prefer to use MySQL with Node.js. AngularJS works quite well with any server, even one running PHP to deliver data from MySQL. You don’t have to be a slave to the acronyms.