The MEAN Stack: An Introduction
MEAN is an acronym, which stands for:
The term was first coined by MongoDB developer Valeri Karpov in this 2013 blog post, where he outlines the advantages of using a single language throughout a technology stack.
This single language programming differentiates MEAN over the then-popular LAMP stack. Short for Linux, Apache, MySQL and PHP, LAMP required developers to know various languages like C, C++, Perl, Python, PHP and SQL.
Let’s take a look at each component below.
MongoDB: The Database
MongoDB is the NoSQL database that stores documents in a JSON-like format.
It also requires no upfront schema, so developers can then jump directly to the development process instead of the data organization process (which, of course, should still be taken care of).
Express: The Backend Framework
Express.js calls itself the “fast, unopinionated, minimalist web framework” for Node.js. It’s lightweight yet robust, which has made it a go-to among developers and the backbone of many applications today.
AngularJS: The Frontend Framework
The frontend component of the MEAN stack, AngularJS lets developers use HTML but it extends HTML syntax by creating new constructs, which spare the developer all the extra coding.
AngularJS modifies the HTML code it first reads from a page through a data binding and dependency injection method. It extends HTML attributes through directives, and binds data to HTML with expressions.
Node.js: The Runtime Environment
Latency is the delay in data transmission or processing. Throughput is the amount of data processed. The sweet spot is to keep latency low and throughput high, which Node.js achieves through its “non-blocking” approach.
Unlike PHP which only executes commands after previous commands finish, Node.js executes commands concurrently, which makes it more time- and memory-efficient.
Advantages of the MEAN stack
Speed, simplicity, and scalability
MEAN’s individual technologies were all built to address speed, flexibility, and usability. The result is a modern and effective technology stack, which has enabled developers to create fast, easy, and highly scalable applications.
The npm registry, the package manager for Node.js, perfectly illustrates these perks. With over 350,000 packages or existing solutions publicly available, developers can easily tap into this resource to make coding faster and easier.
Single language programming = Developer productivity
Teams can then better collaborate because everyone speaks the same language, from backend to frontend.
Individual developers can also more seamlessly explore or transition other facets of the development process, without the extra hassle of having to learn another language.
Not only is the MEAN stack free and open-source – it also offers reduced development costs made possible by single-language programming.
MEAN.js enables developers to contribute throughout the whole development cycle instead of hiring separate help, not to mention that developers are also able to share and reuse code extensively.
Disadvantages of the MEAN stack
It’s always worth investigating – and maybe even implementing – the “Next-Big-Things” and “It” technologies like the MEAN stack. But that never means it’s right for your project.
Richard Clayton illustrates the importance of reflecting on one’ chosen technology or stack in the appropriately-titled, “MEAN’s great, but then you grow up“. Needs and teams evolve over time, and developers must always keep their finger on tech’s ever-changing pulse.
The rise of alternatives to the MEAN stack like MERN, which uses React.js instead of Angular.js, and MEVN which uses VueJS, shows that development teams can tweak existing framework options to suit their needs.
Companies & applications that use the MEAN stack
Here are a few examples of companies that use the MEAN stack to get the job done.
Helping teams build faster and keeping them “un-stuck” is Airpair’s mission. It’s a service that pairs development teams with experts, in the hopes that it would “stop people from giving up because of technology”.
Airpair CEO and Founder Jonathon Kresner rebuilt AirPair.com from scratch in three months and chose the MEAN stack to do so.
The leading global provider of fresh food at home is powered by the MEAN stack, among other technologies, enabling them to deliver meal kits to households in more than 11 markets.
Trustroots is a travelers’ community for sharing, hosting, and getting people together, with over 30,000 members.