MEAN vs LAMP – How Do They Stack Up?Posted by Itay Herskovits on Aug 25, 2014
The Operating System
The first choice in any tech stack is the operating system. While the LAMP stack locked the operating system to a variant of Linux, the MEAN stack has no such restrictions. Linux is still a good choice for an app built on MEAN, but it is by no means the only option; any operating system that can run Node.js is a viable alternative.
The Web Server
The Data Store
The MEAN stack replaces LAMP’s use of MySQL (or another relational database) with MongoDB (or an equivalent non-relational database). For many web apps, this will be the most significant change. Translating the data in an existing SQL database requires a lot of forethought to eliminate redundant/unnecessary object attributes, and will likely require a custom software suite to accomplish. However, once this is done the database will be much faster for data retrieval.
MEAN makes use of Express.js and AngularJS to drive web page presentation and control flow, tasks covered by PHP or Python in the LAMP stack. Express.js serves as the controller layer, directing application flow and marshaling data for AngularJS, which handles data presentation. The primary benefits offered by these scripts are a simplified back-end architecture – for example, Express.js weighs in at only 1,143 lines of code – and a purely client-side presentation layer in AngularJS that can be easily embedded into any existing web application. Furthermore, usage of Express.js and AngularJSo n top of Node.js gives your technology stack the added benefit of being entirely in one language, meaning your front-end developers now have the ability to trace all the way down the stack without having to learn another programming language.
Probably the biggest choice to be faced when converting from LAMP to MEAN is the choice of data store. While the MEAN stack is designed to work with a non-relational database, there are plug-ins for Node.js that allow the stack to run off of a relational database just as easily. The front end handles everything in JSON, so the only true consideration is how the data is stored before it is retrieved, or the difference between Relational and Non-Relational databases.
Relational databases, with their support for highly complex structured queries, lend themselves well to performing complex calculations with data. Non-relational databases excel at managing operational data, such as a list of objects in a system. The lack of a schema allows for fluid object definitions that don’t require extensive code changes, and by removing the need for extensive and complicated queries the system can often operate more efficiently than a similar architecture build over a relational database.
Get a free hosted AngularJS backend with features such as user management, social signin, payment integration, security and more – GET STARTED NOW.