MEAN vs LAMP and beyond: which tech stack to use
Ryan Thelin
Posted on April 23, 2021
Technology stacks, sometimes called web stacks, are collections of layered technologies that each fulfill a necessary role in the web application development process. Most tech stacks feature a tool for a back-end web server, front-end UI, and a database.
Your choice of tech stack at the start of your projects is crucial because it defines what tools your developers will be able to use and what features/attributes your application will benefit from. The current most popular tech stacks are the MEAN and LAMP stack.
Today, we'll explore the advantages and disadvantages of the MEAN stack, the LAMP stack, and other popular options to ensure you choose the right stack for your next project.
Here’s what we’ll cover today:
Build your next web application right
Explore all the trade-offs and tools you'll need to consider for your next web app development project.
Scalability & System Design for Developers
What is MEAN?
MEAN is an open-source high-level, Javascript-based stack best used for building dynamic websites and applications. The term MEAN was coined in 2013 by Valeri Karpov as an acronym to describe applications that are built using a combination of the same 4 tools. These tools work well together and provide unique benefits to any MEAN application.
The biggest advantage of MEAN stack development is that all layers use JavaScript, which makes it easier to integrate the different components and allows for full-stack software development.
The layers of MEAN are:
MongoDB: A NoSQL database that uses binary JSON documents with schema.
Express.js: A modular web application framework for Node.js
AngularJS: A client-side application framework used to build end-user interfaces separate from the business logic. This can also be replaced with similar popular frontend frameworks like React or Vue
Node.js: An application runtime environment that represents the "JavaScript everywhere" paradigm that MEAN is known for. Node.js is an essential component of the MEAN stack and cannot be replaced.
MEAN is best for cloud-native, modern web apps developed by smaller teams or start-up companies. MongoDB allows you to easily create cloud-native apps due to its scalability, testing, and deployment functionalities. Further, AngularJS is ideal for creating single-page applications (SPAs) from quick-loading optimizations. You can even develop cross-platform mobile apps using Express.js
MEAN's single language JavaScript setup allows smaller project teams to more. With other stacks, you'd need multiple programmers with different programming language skills to build a full application. This splits your team and limits how fast the application can be developed.
Teams can create MEAN applications much faster because each JavaScript developer can act as a full-stack developer and contribute across each application layer.
Several top companies like Netflix, Paypal, The Weather Channel, and Forbes have adopted MEAN components for their applications. MEAN's popularity is only projected to grow with more companies transitioning to full-stack development teams and cloud-native web applications.
Pros and Cons of MEAN
Pros
All tools in MEAN use JavaScript, allowing for full-stack development
All tools are open-source
MongoDB allows you to develop, test, and deploy cloud applications with ease
Includes a web application presentation layer for demonstrations and live updates
Great performance for SPAs
Usable on any operating system (does not mandate a specific operating system)
Cons
Hard to adopt into existing architectures, as some older applications will not use JavaScript
Risk losing data during heavy workflows, not ideal for larger applications.
Maintenance can be a hassle, as each technology receives frequent updates and changes
What is LAMP?
LAMP is the world's most popular tech stack, designed to build applications without reliance on external software or data. LAMP is the most mature tech stack and has been in use since its creation in 1998 by Michael Kunze. It gained widespread popularity as the first open-source tech stack and remains popular even today on enterprise or longstanding applications.
The main advantage of LAMP is its maturity and widespread popularity. As the longtime leader in web tech stacks, LAMP technologies are must-have compatibility to any new tool. LAMP uses PHP and the MySQL database, which are particularly well known and are supported by most host providers.
The stack has also become particularly customizable thanks to a wealth of time and users that have adapted its pieces to specialized tasks. In short, the current web applications toolkit is made to suit LAMP.
The layers of LAMP are:
Linux: An open-source, Unix-like operating system consisting of a package management system around a Linux kernel.
Apache Web Server: a highly popular and fully-featured web server, used by 54% of all sites on the web.
MySQL: a multithreaded SQL relational database management system built for at-scale use. More recently, some companies have chosen to use PostgreSQL or even NoSQL non-relational databases like MongoDB.
PHP: a server-side scripting language designed for web development. This can be replaced with Perl or Python-based on other tool compatibility or developer needs.
LAMP is mainly used for large-scale, enterprise applications that need to maximize uptime. LAMPs non-blocking structure allows them to remain responsive even at higher workloads.
It's a well-supported stack with many already developed setups, modules, libraries, and add-ons that let your company customize each technology to suit their needs. For example, you can further increase its availability by load balancing between multiple web or database servers. These high availability setups include layers of redundancy to make sure there are always enough resources to serve users.
Finally, all operations are server-side and do not rely on client-side resources. This means you can distribute LAMP applications to a wide range of users and trust that each has a similar experience.
LAMP is used by many big companies across the world, including Facebook, WordPress, Wikipedia, Slack, and Tumblr. While it currently has the market majority, many experts think LAMP will phase out of use as MEAN and other stacks continue to develop.
LAMP has essentially been grandfathered into the top spot among tech stacks, but newer apps often opt for MEAN for better support of modern features like cloud hosting.
Pros and Cons of LAMP
Pros
Widespread support for each technology in the stack
Mature stack with a wealth of previous solutions and customizations to draw from
Non-blocking structure makes it easy to scale and faster to develop
LAMP is fully open-source
PHP and MySQL are easy to learn and work with
Cons
Limited to only Linux operating system
Difficult to switch between back and front-end tools
Does not integrate well with the cloud
Projected to decline in use over time due to the prevalence of JavaScript and the cloud
Keep the learning going.
Learn the ins and outs of every major technology stack. Educative's text-based courses are easy to skim and feature lived examples - making learning quick and efficient.
Scalability & System Design for Developers
Other top tech stacks
While MEAN and LAMP are the top technology stacks on the market right now, there are many other stacks available for niche situations and solutions. Some of these are just variations on the two bigger stacks, while others are innovative new players in the market.
Let's take a quick look at these honorable mentions.
MERN
The MERN stack is a variation on MEAN that replaces Angular.js with React.
React uses a virtual DOM to simplify UI changes and is optimized for highly reactive single-page applications. React also uses JSX to enable flexible component manipulation. The biggest downside of React is that it is missing features in its base state as a library rather than a fully-featured framework.
Replacing Angular with React essentially sacrifices features for ease of use and flexibility.
Advantages:
Increased ease of use over MEAN without sacrificing full-stack development capabilities
Optimized for SPAs
There are more React developers than Angular.js developers
Disadvantages:
Sacrificing some functionality without a full framework
Modules required to fill in some missing functions
Use Case:
You're looking to build a simple to intermediate single-page application in the quickest time possible or your team is already familiar with React.
MEVN
Similar to MERN, MEVN replaces Angular.js with Vue.js.
Vue is an underdog framework that offers a minimalist, performance-driven approach. It's more lightweight than either Angular.js or React and comes with all major features out-of-the-box. Vue can also be augmented with third-party services to fill in any niche behaviors specific to your needs. Vue's biggest downside is that it's not widely used and may not have the community or integration support enjoyed by React or Angular.
Vue is essentially a barebones framework that sacrifices fancy features and some control to be as fast and easy to set up as possible.
Advantages:
Faster performance than React and Angular
Ready to go right out of the box
Cost-effective due to simplicity to use
Disadvantages:
Lacks resources as the least popular of the three frameworks
Fairly new, meaning you'll have to update often
Use Case:
You're looking for the best performance you can get and don't have plans to add any fancy application features.
Ruby on Rails (RoR)
Ruby on Rails is a developer-friendly technology stack built with the opinionated Ruby programming language. Ruby on Rails is unique in that it contains all tools of a standard tech stack in a single package. It's also integrated from the ground up with HTML, CSS, and JavaScript.
RoR is designed to make it as easy as possible for your web developers to build a new application due to mandatory best practices and built-in default structures. It also offers improved performance as all tools are seamlessly integrated to make the UI easy to manipulate.
Advantages:
Quick to spin up new applications using default structures
Robust bug detection system
Lightweight
Disadvantages:
Not very customizable
Fairly uncommon
Use Case:
You want to produce a solid web application as quickly as possible and don't need it to be too complex.
Serverless
The rise of cloud computing has led many companies to shift from managing their own app infrastructure to instead building cloud-native serverless applications. These serverless applications allow the cloud provider like AWS or Azure to handle all the services and tools for a price that matches your company's scale.
Serverless applications are great at scaling to meet demand, and they'll handle any maintenance. The downside is that you don't have as much control over the technologies you're working with since you’ll be stuck with out-of-the-box features.
Advantages:
Cost-effective for small businesses and startups
No need to manage or maintain your own technologies
Disadvantages
Less control over what technologies are in the stack
Scaling costs will make this ineffective beyond a certain size
Use Case:
You're a small startup that cannot afford to hire a full team to manage your application's tech stack and would rather pay to have someone else do it.
Picking the right tech stack
MEAN or LAMP are the best fit for most projects, but how do you choose?
Both have tradeoffs, so it's important to consider what factors are most important to your particular project.
You'll want to consider:
What type of app will it be? Cloud-based, hybrid, etc?
What is the expected lifetime of this application?
What technologies are available in my client's infrastructure? Will it be standardized or varied?
How much traffic will your application need to handle? Does the traffic happen in spikes or steady flow?
How dynamic will your application be? Will it update in real-time?
How much retraining will your team need to do?
How much maintenance do you want to allocate to the application?
As a general rule, MEAN is better for smaller-scale modern applications like progressive web apps, cloud-based applications, or single-page applications. LAMP is better for larger-scale applications that prioritize uptime and availability.
The most important point to consider is a lifetime. LAMP is well established and stable but is projected to be phased out by the modern functionalities granted by MEAN.
Choosing to create a new application on LAMP now means you'll have a good application now but may have to fully migrate to MEAN in the future.
Choosing MEAN now will mean it'll be harder to maintain and you'll have fewer time-tested solutions but you'll have top modern features to prepare for the future.
MEAN
App type: Modern app types like Cloud, hybrid, PWAs, or SPAs
Lifetime: Long lifetime, building the application for future MEAN support
Traffic: Consistent low to mid traffic, no redundancy needed
Client or server-side: Client-side rendering
Dynamic or static: JavaScript allows for event-driven applications with real-time updates.
Training: Only need to learn JavaScript.
Maintenance: High maintenance to support the frequent updates to each tool.
LAMP
App type: Multiple page applications
Lifetime: Short lifetime, you're designing this application to work now and in the near future only.
Traffic: High traffic with large spikes at peak hours.
Client or server-side: Server-side, you don't want to rely on client infrastructure for a good experience.
Dynamic or static: The app is a static application that doesn't need real-time updates.
Training: The team will have to learn multiple tools, but PHP and MySQL are easy to pick up.
Maintenance: Low maintenance, ecosystem is stable.
Wrapping up
Choosing the right tech stack for your project is a big choice. With the information you learned today, you'll be able to make the best choice to fit your team and company. Your next step is to learn more about web architectures to get familiar with all the options available for your next project.
To help you learn everything you need to know about web architecture, Educative has created the Path Scalability & System Design for Developers. This course explores all the choices you have to make when designing your web application and lets you understand the trade-offs at each step.
By the end of the course, you'll have the skills to implement microservices architectures across different tech stacks, create a cloud-native application, and practice explaining trade-offs for your next interview or conference meeting.
Happy learning!
Continue learning about web applications
Posted on April 23, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.