Hi there, and thanks so much for joining us.
My name is Bradley Knapp and I'm with IBM
and I'm here answering your questions,
kind of basic questions about computing and cloud computing,
and the question that I'm here to answer today, and hopefully you're going to find this really useful,
is what is a "MEAN stack"?
It's getting a lot of uptick, a lot of questions lately,
I've had people come up and ask me what it is,
and so we really want to drill into what is this MEAN stack thing?
What does it mean? You hear it in reference.
And a MEAN stack is a application stack,
including the application and the database,
to run a website or a web-based application,
but it's designed to run it entirely written or compatible with JavaScript.
So, this is different from a LAMP stack where you're lower level, right?
You're talking about Linux, you're talking about Apache,
you're talking about a MySQL database
and you're talking about the PHP language.
Everything in a MEAN stack is JavaScript compatible.
And so what is MEAN?
Well, MEAN, again, four-letter acronym,
that first one, the M, it's your database.
But rather than MySQL, in a MEAN stack, this is almost always Mongo.
So, MongoDB.
Again, because of its friendliness with JavaScript.
Now, does it have to be Mongo?
No, it doesn't.
It could be Maria.
It could be any number of databases.
But Mongo is the free and open source
database that is generally associated with running a MEAN stack
because that's the other component
is MEAN is free and open source software, right?
If it's a proprietary or paid-for software,
it's not going to fall into the purest definition of a MEAN stack.
So, next letter down, we've got our database, we've got an E.
E is for Express.
Sometimes called Express.js.
What is Express?
So, Express is that layer
within your application stack that's going to talk to the database, right?
So, Express is going to take those requests that come in.
It is going to fetch and it is going to send the data that comes back and forth out of that database,
again using JavaScript.
Next layer is our A.
A, in this case, is Angular.
Now, does it have to be Angular?
It doesn't, it could also be React.
But Angular, or React, these again are JavaScript compatible frameworks.
And so this is your application layer.
This is your display layer, this is your interaction layer.
So when somebody comes to your web site,
when they come to your web application,
what they are interacting with, that is all done and displayed using Angular.
And then our last piece is the N, or Node.js.
M.E.A.N.
What is the Node layer?
The Node layer is your parsing and your return layer.
What is the purpose of parsing and return?
Well, we're going to get into the specifics here in just a moment.
But these are those four fundamental components.
What do they all have in common?
They're all free, open source,
and they are the stack,
the full stack, if you like the term "full stack",
that you need in order to build in this framework, in this MEAN framework.
Now, one of the thing that does set this apart a little bit that does make it different
is you are one layer up the stack here.
You're not talking about infrastructure the way that we talk about it
at the operating system level in a LAMP stack.
And so this MEAN stack, it can be installed onto a physical server,
or onto a virtual server,
but it can also be containerized and deployed in a micro-instance manner.
And so you can make this microservices based.
You can use Docker to deploy it, or whatever your technology of choice is,
but it is possible to separate all these out into microservice instances and then run it that way.
You aren't forced to run on a virtual server or a physical server the way that you are with a LAMP stack.
So, now that we've got the pieces of our stack,
let's talk a little bit about how they work.
What makes this a good framework, right?
So, we're going to imagine our little happy guy here because he's always happy
and he's got his laptop,
and on his laptop he decided he's going to go to your website.
How does that work?
Right, so from the laptop, we're going to go out here into the cloud, into the internet,
and then we are going to get into our stack.
Now, unlike LAMP, where our four letters are logically laid out,
MEAN is not quite as logical because it doesn't follow the obvious alphabetic instance.
So for our MEAN stack, the first piece that he's going to interact with is Angular, right?
So Angular is again, that presentation layer that's going to be what he views and then underneath Angular ...
So, he's going to come to your website, and he browses around on it, clicks on it, and he wants to learn more.
And so Angular is then going to take that, and Angular is going to transmit that request to Node.
Node is going to take that request that it got from Angular, it is going to parse it,
and it is going to pass it into our Express.
And then Express is going to take that parsed request
and it's going to send it down here to our Mongo database.
And so the flow is Angular to Node, to Express, and then it goes back up, right.
So, you're making the request and parsing the request on the way down.
You get your data out of your MongoDB database and then you're going to return that back up,
you're going to return it back up again, and you're going to display it at the top.
And browsing a website, every time you click, this is what's going on, right?
And again, you can deploy it microservice based.
You can deploy container based.
You can deploy it on a single virtual server.
That's really up to you.
But that is an overview of what the MEAN stack is, of how it works,
and why you might want to consider it for your websites or your web based applications.
Thank you so much for your time today.
If you have any questions, please drop us a line below.
If you want to see more videos like this in the future,
please do like and subscribe and let us know.