LAMP vs. MEAN Stack

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

In the MEAN stack, the web server – provided by Apache in LAMP – is provided by Node.js. This can improve the performance of the application, as Node.js is entirely non-blocking and event-based, allowing for true concurrency among requests. Node.js is lightweight and relatively new, however, which ultimately means that your organization will be largely on its own when it comes to non-standard extensions. While there is active plug-in development for Node.js, the technology is not as matured as Apache. This usually means that you need to write your own plug-ins to cover the areas where Node.js is missing functionality. Additionally, choosing Node.js locks all code on your web server into JavaScript. For new development this isn’t a major concern, but converting a back-end of significant complexity can be time-consuming.

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.

The Code

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.

Additional Considerations

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.

Conclusion

Converting to the MEAN stack gives your development team a number of benefits, the three most significant being a single language from top to bottom, flexibility in deployment platform, and enhanced speed in data retrieval. However, the switch is not without trade-offs; any existing code will either need to be rewritten in JavaScript since MEAN is pure JavaScript from back to front end. Ultimately the choice to switch to a MEAN stack from LAMP will be based in your organization and the priorities for the project under development. PayPal has already switched its system to Node.

要查看或添加评论,请登录

Salman Ghauri的更多文章

  • Fog Computing and Spark

    Fog Computing and Spark

    While big data analytics may be getting a lot of attention, the concept that really sparks the tech community’s…

  • Key Uses of Apache Spark

    Key Uses of Apache Spark

    Here are some of the most common and important uses of Spark that I have came across. These will help you to understand…

  • Database Choice for Analytics

    Database Choice for Analytics

    It is not a best practice to query your data from a production database because you could reorder the data and likely…

  • Docker Compose - Build powerful an d portable applications.

    Docker Compose - Build powerful an d portable applications.

    The next thing in developing a containerized application using docker is to use its utility which is named 'docker…

  • Skeptical data scientist.

    Skeptical data scientist.

    US election results 2016 proved most of the predictions made by data scientist wrong. It open a new challenge for data…

  • Docker

    Docker

    Want to go deeper in Docker? Check out my series of docker tutorials. Any kind of feedback is highly appreciated.

  • Laravel vs. ROR

    Laravel vs. ROR

    Laravel is no doubt an up and coming PHP framework, and the support which the community has shown towards it is simply…

    2 条评论
  • Migrations in PHP

    Migrations in PHP

    Are you searching for PHP seven migration? If thus then you want to study the nineteen new options launched in PHP…

  • Tech'16

    Tech'16

    2016 is going to be big for developers, already with the launch of PHP 7 and node.js OS has surprised the world.

    2 条评论

社区洞察

其他会员也浏览了