Learning Library

← Back to Library

Understanding the MEAN Stack

Key Points

  • The MEAN stack is a full‑stack JavaScript solution for building web applications, analogous to the LAMP stack but using only JavaScript‑compatible technologies.
  • **M** stands for MongoDB, a NoSQL database chosen for its native JSON handling (though other open‑source databases can be used).
  • **E** is Express.js, the middleware layer that processes incoming requests and communicates with the database using JavaScript.
  • **A** represents the front‑end framework—typically Angular (or an alternative like React)—which renders the user interface and handles client‑side interactions.
  • **N** is Node.js, the runtime that executes server‑side JavaScript, parses requests, and returns responses, completing the open‑source, JavaScript‑only stack.

Full Transcript

# Understanding the MEAN Stack **Source:** [https://www.youtube.com/watch?v=DP7TSgc6glc](https://www.youtube.com/watch?v=DP7TSgc6glc) **Duration:** 00:06:39 ## Summary - The MEAN stack is a full‑stack JavaScript solution for building web applications, analogous to the LAMP stack but using only JavaScript‑compatible technologies. - **M** stands for MongoDB, a NoSQL database chosen for its native JSON handling (though other open‑source databases can be used). - **E** is Express.js, the middleware layer that processes incoming requests and communicates with the database using JavaScript. - **A** represents the front‑end framework—typically Angular (or an alternative like React)—which renders the user interface and handles client‑side interactions. - **N** is Node.js, the runtime that executes server‑side JavaScript, parses requests, and returns responses, completing the open‑source, JavaScript‑only stack. ## Sections - [00:00:00](https://www.youtube.com/watch?v=DP7TSgc6glc&t=0s) **Understanding the MEAN Stack** - IBM’s Bradley Knapp explains that a MEAN stack is a JavaScript‑centric web application architecture—typically MongoDB, Express, Angular, and Node.js—used to build websites, highlighting its differences from the traditional LAMP stack. - [00:03:05](https://www.youtube.com/watch?v=DP7TSgc6glc&t=185s) **MEAN Stack Overview & Deployment** - The speaker outlines the free, open‑source components of the MEAN full‑stack, highlights its flexible deployment options—including containers and micro‑services—and begins illustrating how a client laptop requests a website. - [00:06:12](https://www.youtube.com/watch?v=DP7TSgc6glc&t=372s) **MEAN Stack Deployment Overview** - The speaker briefly explains the MEAN stack, its deployment options (container‑based or single virtual server), and encourages viewers to ask questions, like, and subscribe for more videos. ## Full Transcript
0:00Hi there, and thanks so much for joining us. 0:02My name is Bradley Knapp and I'm with IBM 0:04and I'm here answering your questions, 0:06kind of basic questions about computing and cloud computing, 0:09and the question that I'm here to answer today, and hopefully you're going to find this really useful, 0:14is what is a "MEAN stack"? 0:19It's getting a lot of uptick, a lot of questions lately, 0:23I've had people come up and ask me what it is, 0:25and so we really want to drill into what is this MEAN stack thing? 0:28What does it mean? You hear it in reference. 0:31And a MEAN stack is a application stack, 0:35including the application and the database, 0:38to run a website or a web-based application, 0:41but it's designed to run it entirely written or compatible with JavaScript. 0:46So, this is different from a LAMP stack where you're lower level, right? 0:50You're talking about Linux, you're talking about Apache, 0:52you're talking about a MySQL database 0:54and you're talking about the PHP language. 0:58Everything in a MEAN stack is JavaScript compatible. 1:02And so what is MEAN? 1:04Well, MEAN, again, four-letter acronym, 1:06that first one, the M, it's your database. 1:10But rather than MySQL, in a MEAN stack, this is almost always Mongo. 1:16So, MongoDB. 1:18Again, because of its friendliness with JavaScript. 1:23Now, does it have to be Mongo? 1:24No, it doesn't. 1:25It could be Maria. 1:26It could be any number of databases. 1:28But Mongo is the free and open source 1:31database that is generally associated with running a MEAN stack 1:36because that's the other component 1:38is MEAN is free and open source software, right? 1:42If it's a proprietary or paid-for software, 1:44it's not going to fall into the purest definition of a MEAN stack. 1:48So, next letter down, we've got our database, we've got an E. 1:53E is for Express. 1:56Sometimes called Express.js. 1:59What is Express? 2:01So, Express is that layer 2:03within your application stack that's going to talk to the database, right? 2:07So, Express is going to take those requests that come in. 2:10It is going to fetch and it is going to send the data that comes back and forth out of that database, 2:15again using JavaScript. 2:18Next layer is our A. 2:21A, in this case, is Angular. 2:24Now, does it have to be Angular? 2:27It doesn't, it could also be React. 2:28But Angular, or React, these again are JavaScript compatible frameworks. 2:34And so this is your application layer. 2:36This is your display layer, this is your interaction layer. 2:39So when somebody comes to your web site, 2:41when they come to your web application, 2:43what they are interacting with, that is all done and displayed using Angular. 2:49And then our last piece is the N, or Node.js. 2:57M.E.A.N. 2:59What is the Node layer? 3:01The Node layer is your parsing and your return layer. 3:05What is the purpose of parsing and return? 3:08Well, we're going to get into the specifics here in just a moment. 3:13But these are those four fundamental components. 3:15What do they all have in common? 3:16They're all free, open source, 3:18and they are the stack, 3:20the full stack, if you like the term "full stack", 3:23that you need in order to build in this framework, in this MEAN framework. 3:28Now, one of the thing that does set this apart a little bit that does make it different 3:33is you are one layer up the stack here. 3:35You're not talking about infrastructure the way that we talk about it 3:39at the operating system level in a LAMP stack. 3:42And so this MEAN stack, it can be installed onto a physical server, 3:46or onto a virtual server, 3:47but it can also be containerized and deployed in a micro-instance manner. 3:53And so you can make this microservices based. 3:57You can use Docker to deploy it, or whatever your technology of choice is, 4:01but it is possible to separate all these out into microservice instances and then run it that way. 4:07You aren't forced to run on a virtual server or a physical server the way that you are with a LAMP stack. 4:14So, now that we've got the pieces of our stack, 4:17let's talk a little bit about how they work. 4:19What makes this a good framework, right? 4:23So, we're going to imagine our little happy guy here because he's always happy 4:29and he's got his laptop, 4:32and on his laptop he decided he's going to go to your website. 4:36How does that work? 4:38Right, so from the laptop, we're going to go out here into the cloud, into the internet, 4:43and then we are going to get into our stack. 4:45Now, unlike LAMP, where our four letters are logically laid out, 4:50MEAN is not quite as logical because it doesn't follow the obvious alphabetic instance. 4:58So for our MEAN stack, the first piece that he's going to interact with is Angular, right? 5:05So Angular is again, that presentation layer that's going to be what he views and then underneath Angular ... 5:15So, he's going to come to your website, and he browses around on it, clicks on it, and he wants to learn more. 5:19And so Angular is then going to take that, and Angular is going to transmit that request to Node. 5:28Node is going to take that request that it got from Angular, it is going to parse it, 5:32and it is going to pass it into our Express. 5:37And then Express is going to take that parsed request 5:40and it's going to send it down here to our Mongo database. 5:44And so the flow is Angular to Node, to Express, and then it goes back up, right. 5:53So, you're making the request and parsing the request on the way down. 5:56You get your data out of your MongoDB database and then you're going to return that back up, 6:01you're going to return it back up again, and you're going to display it at the top. 6:05And browsing a website, every time you click, this is what's going on, right? 6:09And again, you can deploy it microservice based. 6:12You can deploy container based. 6:13You can deploy it on a single virtual server. 6:15That's really up to you. 6:17But that is an overview of what the MEAN stack is, of how it works, 6:21and why you might want to consider it for your websites or your web based applications. 6:28Thank you so much for your time today. 6:30If you have any questions, please drop us a line below. 6:33If you want to see more videos like this in the future, 6:36please do like and subscribe and let us know.