Introduction to the MERN Stack

Anjana De Seram
3 min readMar 6, 2021
1.0 MERN Stack

What is MERN stack?

MERN stack is a web development framework and it is a combination of four technologies: MongoDB, ExpressJS, ReactJS, and NodeJS. These components provide an end-to-end framework for developers to work in.

  • M = MongoDB : A cross platform document database.

This is document oriented NoSQL (Non-relational) database used to store the application data.

  • E = Express.js : A Backend web application framework

This is a web application framework for NodeJS. Used to build the backend of a site using NodeJS functions and structures

  • R = React.js : JavaScript library for building user interfaces

React is a tool for building UI components. This is a client side JavaScript framework. Maintained by Facebook.

  • N = Node.js : A cross-platform JavaScript runtime environment

Open source server environment. It is available for Windows, Linux, Unix, and Mac OS. It executes JavaScript code outside of the browser.

How does MERN stack works?

1.1. MERN Stack Development
1.1 MERN Stack Development

Developing Front-end with React.JS

In MERN stack we use React for the front-end development. That means it allows us to build up complex interfaces through simple Components and connect them to data on our backend server, and render them as HTML. We can use React for the single page web applications, complex software applications and mobile applications.

Following are some reasons why developers choose React with this stack for the front-end development.

  • Faster development
  • Strong community support
  • Can build rich user interfaces easily
  • Due to modular structure react code is easy to maintain.

Developing back-end with Express JS and Node JS

For the backend development we have to use Express JS, Node JS and the mongoose. Express.js is a server side framework which running inside the Node.js server. Simply it is a back-end web application framework for the Node.js framework. Express.js is handling HTTP requests and responses.

MongoDB — the Database

MongoDB is a NoSQL database which allows you to manage the database in MERN stack. MongoDB stores data with a much flexible document using JavaScript Object Notation (JSON) — based query language. It is quite faster than the other query languages.

MongoDB’s horizontal, scale-out architecture can support huge volumes of both data and traffic. MongoDB is known for being flexible and easy to scale and it simplify the work such as database installation, configurations and administration.

Is MERN a full stack solution

Yes MERN is a full stack solution. This following three tier architectural pattern. Front-end tier (React.js), application tier (Express.js and Node.js) and the database tier (MongoDB).

Advantages of MERN stack

  • Cover the full web development cycle from front-end development to back-end development using JavaScript.
  • Developers only need to be proficient in JavaScript and JSON.
  • Feasibility of four technologies: MongoDB, ExpressJS, React, NodeJS
  • All the technologies in MERN stack are free and open source.
  • Support MVC architecture.
  • Have some set of pre-build exclusive testing tools.

Why should I choose MERN stack

The coders who are using the MERN stack is each line of code is written in JavaScript. It is nearly universal programming language, both client -side and server -side. Cover the full web development cycle from front-end development to backed-end development using JavaScript. It supports to the MVC architecture. MERN stack eliminates the needs for context switching, because of using a single programming language. So it’s helps to simplify the entire development process. For tech stack with multiple programming languages, developers have to figure out how to interface them together. But using JavaScript stack like MERN, developers only need to be proficient in JavaScript and JSON.

I hope you learn something about MERN stack and why most people prefer to use it. Thank You!!!

--

--

Anjana De Seram
0 Followers

Software Engineer undergraduate at Sri Lanka Institute of Information Technology(SLIIT)