What is the MEAN Stack and Why is it Better than LAMP?

Developing a Web-driven application (either mobile or browser-based) typically requires the provisioning of some server-side infrastructure as well as the development of some code to run on it. Such code will often consume APIs. But occasionally, it provide them as well. For many years, the go-to infrastructure in such situations was affectionately referred to as the LAMP Stack and it primarily involved Linux, Apache, MySQL and PHP, Perl or Python. But, thanks in part to JavaScript’s applicability to both client and server-side scripting, there’s a another stack that’s now widely considered as an alternative to LAMP; the MEAN stack.

As this MEAN (MongoDB, ExpressJS, AngularJS, NodeJS) stack gains in worldwide popularity, it begs the question of whether or not this is the end of LAMP? Before saying Yes or No, let’s first get to know a little bit about these two Web platforms.

LAMP (Linux, Apache, MySQL, PHP)

It is one of the earliest stacks to get traction and the most traditional stack mode,  is made up of all free, open-source software elements that work well for Dynamic web sites and applications. LAMP includes the Linux operating system, PHP application software, MySQL database and the Apache Web server. It’s flexible, easy to develop applications with, easy to deploy, customizable, secure, and comes with a huge support community. LAMP’s open source nature is also one of its greatest benefits.

LAMP stack

Some Of The Key Variations:

  • WAMP (Windows, Apache, MySQL, PHP): A Microsoft Windows OS (Operating System) equivalent that’s easy to get started with. The WIMP stack (Windows, IIS, MSSQL Server, ASP.net) is similar, but relies on Microsoft’s Internet Information Server (IIS) instead of Apache for Web serving and ASP.net instead of Perl, PHP, or Python for programmability.
  • LAPP (Linux, Apache, PostgreSQL, PHP): IT is a PostgreSQL database variation that’s optimized for enterprise-level projects.
  • MAMP (Mac OS X, Apache, MySQL, PHP): A MacOS X operating system variation and is available for Windows and Mac.
  • XAMPP (Linux, Mac OS X, Windows, Apache, MySQL, PHP, Perl): It  includes an FTP server, which is cross- Platform, and is able to run on Linux, Mac operating and Windows systems.

A Lean MEAN Substitute

The MEAN stack is a more modern stack that’s challenging the LAMP stack. It is completely JavaScript-powered. So that makes  it both a time and money-saver for organizations that already have JavaScript pros writing client-side code. MEAN includes the MongoDB database, the AngularJS Front-end Framework, Express.js (a Web framework for Node.js; the leading JSON-powered NoSQL database that offers more flexibility than a relational SQL database), and a base platform of the Node.js runtime, rather than an operating system like Linux or Windows. One variation of the MEAN stack is the MEEN stack which substitutes the Ember.js framework for Angular JS.

MEAN stack

Benefits of the MEAN Stack

There are some great reasons why many view the MEAN Stack as having the upper hand over the LAMP Stack:

Node.js lets you to write server side applications by using Javascript thereby releasing Javascript from the shackles of the web browser. Node.js is also faster and more scalable than other server side technologies including LAMP because of its non-blocking architecture.

AngularJS is an open source client-side Javascript framework  that is developed and maintained by a few smart people at Google. Angular JS has been creeping into  many projects for a bit while now and  a few of  the projects have front end parts powered by Angular JS. It has solved many development issues when making reusable, maintainable or testable client-side applications powered by Javascript.  One of the great things about this framework is its powerful directives that evolve into domain-specific language, and keeping things highly testable and reusable.

MongoDB is a document-oriented database that allows you to store documents in JSON format, JSON stands for JavaScript Object Notation. MongoDB is therefore a format that JavaScript natively understands. If your server-side code is written in Javascript and your client-side applications are also in Javascript, then it makes sense to use a database with a JavaScript flavour.  Given how MongoDB naturally responds in a format that’s understood by the Javascript-driven Node.js, the code it takes to serialize and deserialize data is dramatically reduced. The most vital thing to note is while you may be using Mongo for some of your projects, you don’t have to make a big blanket commitment to displace your old databases.

Relational databases like MySQL have been around for three decades and they surely have their place. It is just a matter of the application's objectives. MongoDB may be better in some cases and MySQL others. But fortunately this doesn’t affect the MEAN acronym. The “M” in “MEAN” can stand for Mongo or MySQL. Critics of the MEAN stack sometimes point out that MongoDB may work well for small to mid-sized applications, but less so for large-scale applications that must service hundreds of millions of users.

If you’re converting from a LAMP to a MEAN stack, then you will have to either rewrite your existing code into JavaScript or integrate it in an invisible way. Keep in mind that there is no one size fits all solution for Web site development, and the right size  for a project’s needs depends on the users,  browsers, devices, infrastructure in play, and the skills and knowledge  of the development team.

Difference Between LAMP STACK and MEAN STACK

LanguagesPerl/PHP/Python: Commonly used programming languages.AngularJS: Extension of Javascript
DatabaseMySQL (RDBMS):  Conventional database systemMongoDB(NoSQL database): A cross-platform document-oriented database system. JSON-style documents with dynamic schemas provide simplicity and power, making the Integration of data into certain applications (particularly Javascript-based ones) fast and easy.
Web ServerApache: Commonly used.ExpressJS: is a Node.js Web application framework. It creates an MVC-like application on the server side. It also allows users to create routes and templates.
Servers“LAMP” is derived from [OS]: Linux (L), Macintosh (M), or Windows (W) Apache web server (A)
PHP (often now also Python and Perl) (P)
Apache is used to host HTTP files, MySQL for databases, and PHP/Python/Perl for Programming language used for creating dynamic webpages.
“MEAN” is derived from MongoDB (M), ExpressJS (E), AngularJS (A), and Node.js (N).

Node.js is the server that runs your application. Node.js is an event-driven I/O server-side JavaScript environment.


LAMP might become outdated in the near future. But it is not the case yet as it is still a reliable player which has established its efficiency over the years. However, the  MEAN Stack is surely an innovative, new and cutting-edge technology package that will perhaps conquer the market shortly.

Be sure to read the next Application Development article: Top 5 Rules For Giving Enterprise Apps A Consumer-Grade UX