LAMP vs. MEAN: Which stack is right for you?

LAMP

Pros:

LAMP is kind of the dinosaur of web development, used by hundreds of thousands of companies and therefore maintained and supported very well. With endless modules, libraries and add-ons available you can adapt it to your company’s needs.

Being Linux based, you will find help for any topic in the large open source community. MySQL is a very reliable and scalable solution. PHP is in version 7 and is also supported by a mature and big community. PHP is also very fast and integrates well with the rest of the stack.

You can control the server and decide which versions and software you install, so you don’t have to depend on the client’s browser. Best for if you have lots of server-side tasks.

Cons:

Because it’s easy to learn, there are a lot of developers out there who are not following best practices and building garbage apps. Starting with PHP is easy, but mastering it is hard. This is also true for security in these PHP apps. Some would also describe it as a script language instead of a real programming language because it’s not strongly typed and not pre-compiled. I’d recommend diving in deeper into pros and cons of PHP, Python or Perl.

As for MySQL, other options are becoming more mature. NoSQL databases like MongoDB are popular among enterprises today due to it’s scalability. Plus, pure JavaScript Stacks like MEAN gain more traction every year and new developers might not be interested in learning all of the LAMP’s skills.

MEAN

Compared to LAMP, the MEAN stack is fairly new. One of its biggest differences is that MEAN is not dependent on a specific operating system – Node.js takes care of server-side execution. The MEAN Stack is especially recommended for JavaScript enthusiasts – as it uses JavaScript at all levels. This also makes it preferred by new developers.

MongoDB is a popular and flexible document based, NoSQL database, compared to MySQL’s relational database system. Angular helps build progressive and modern web apps.

Its components are:

MongoDB (Data persistence)

Express.js (server-side application framework)

Angular.js (client-side application framework)

Node.js (server-side environment)

This stack has some derivatives too:

MERN (React instead of Angular)
MEEN (Ember.js instead of Angular)

Pros:

Using JavaScript as the primary programming language is a huge advantage. Everything can be set up quickly and done in JS, which makes it much easier to find developers, and LAMP developers typically know JavaScript as well. MongoDB is very popular for its easy schemaless data persistence and is faster than MySQL if you have a lot of read requests. The fact that Angular is maintained by Google is also a big plus. It receives new releases and functions on a constant basis. Another huge advantage is the ability to easily build mobile or desktop apps, for example with Ionic. Code and components can easily be reused or added.

Cons:

Like all new technologies, MEAN’s glamour is creating some hype. Developers fall for this hype and build their apps in JavaScript, just because it’s trendy. Many of these libraries and frameworks are quite new, and new versions get released quickly, so maintaining your app can become quite a hassle. Since many technologies disappear after a few years, sustainability can become an issue. It’s also harder to maintain a clean code base and follow best practices as your app grows. Further, you have to rely on the client and the client’s available technologies e.g. if you are targeting IE users, embedded systems or low end PCs, there may be usability issues.

A few other stacks to consider:

WISA

Windows Server / IIS / Microsoft SQL Server / ASP.net

Not open source, but all components are from Microsoft, so it should work seamlessly.

LAMP (With MongoDB)

Linux, Apache, MongoDB, PHP

NoSQL Databases like MongoDB can also be used in a classic LAMP environment.

Ruby Stack

Ruby/Ruby on Rails/RVM (Ruby Virtual Machine) / SQLite

This stack is losing popularity. Ruby on Rails was an often used framework once, and thus the whole stack.

Java+Spring

Preferred by large enterprises and shied by indie developers for its complexity, Spring offers an entire full-stack framework written in Java.

Django Stack

Python / Django / Apache / MySQL

The Django framework is loved by Python developers, delivers performance and is often referred to as an easy to learn stack.