UmiTech

MEAN Stack là gì?

Cover Image for MEAN Stack là gì?
Nếu bạn đã từng làm việc với javascript thì chắc hẳn đã nghe nhắc đến MEAN Stack, đây là xu thế tuyển dụng hiện nay. Vậy chúng ta tìm hiểu xem MEAN Stack là gì, cấu trúc và ưu điểm của nó nhé

Introduction

The MEAN stack is a collection of tools that help you quickly create web applications using technologies like MongoDB for document storage, Express as the web application framework, AngularJS for the frontend and NodeJS as the server side JavaScript environment. It's easy to get started with this stack because it's all based on open source tools. Let's explore what it is and how it works!

The MEAN stack

The MEAN stack is a collection of tools that help you quickly create web applications using technologies like MongoDB for document storage, Express as the web application framework, AngularJS for the frontend and NodeJS as the server side JavaScript environment.

It's easy to get started with this stack because it's all based on open source tools.

Let's explore what it is and how it works!

What are the advantages of MEAN?

MEAN provides an easy way to get up-to-speed with data modeling, especially if you are working on your first project or have limited experience in building relational databases. Since all documents are stored in one place, there is no need to join multiple datasets together.

MEAN also offers considerable performance gains. There are various caching tools available so you can easily cache certain data to avoid having to interact with the database every time.

What is MongoDB?

MongoDB is a document-oriented database. It's mostly used for storing unstructured data, meaning information that doesn't have a defined structure like an inventory list, a photo archive or an online book collection.

What is Express?

Express is a minimalistic web framework for NodeJS. It's similar to other web frameworks like Ruby on Rails and Django but with some important differences: it integrates better with AngularJS and has a simplified routing system which allows you to write less code while still maintaining flexibility and extensibility.

What is AngularJS?

AngularJS is a JavaScript framework for developing single page web applications. It's written on top of Express and helps you create dynamic, interactive, modern user interfaces with just HTML as the templating language. It provides an easy way to organize your application by splitting it into several loosely coupled components which communicate with each other via services.

What is Node JS?

NodeJS is a server environment for running JavaScript outside of browsers. Your app will be run in this environment so it can execute any module available like file system accessors or other native modules that may exist on the host operating system (although most modules are only available on certain platforms). Unlike traditional server side environments like PHP, ASP.NET or Ruby on Rails, NodeJS is a non-blocking environment which means it will never stop until all the tasks are finished even if they take a while to complete.

What's the difference between MEAN and LAMP?

LAMP usually refers to a stack where Apache is used as the web server, MySQL for data storage and PHP as the server side programming language. In this case, MEAN would be a more accurate replacement because it uses Express instead of Apache, MongoDB instead of MySQL and AngularJS instead of PHP.

All these technologies can still work together though! For example you can use both LAMP AND MEAN in a single system by using Apache as your web server and hosting the AngularJS app as a static HTML page.

Why you should use the MEAN stack

One of the things about the MEAN stack that makes it really easy to use is the fact that all the components are open-source so you can find lots of tutorials, documentation, and templates. You'll find out quickly if something is missing, since there's a large community of users who actively contribute to this project.

The MEAN stack is also well-suited for getting started because all four tools are needed to create a web application. You need MongoDB for storing your data, Express as the server framework, AngularJS to create HTML pages with Javascript, and NodeJS for handling server-side scripts. It's really easy to install these tools too - just check them out on their own websites!

The MEAN stack also has a large developer community, which means you're more likely to find answers to your questions and that others have come across the same issues as you. Don't worry about having to reinvent the wheel.

Conclusion

The MEAN stack is a collection of tools that help you quickly create web applications using technologies like MongoDB for document storage, Express as the server framework, AngularJS to create HTML pages with Javascript and NodeJS for handling server-side scripts. It's easy to get started with this stack because it's all based on open source tools. The MEAN stack also has a large developer community which means you're more likely to find answers to your questions and others have come across the same issues as you. Don't worry about having to reinvent the wheel when choosing what tool best suits your needs!

Thank you for reading and I hope this article was informative. Thanks to my colleagues who helped with their expertise in the subject.