Tech Stacks : Why should we MERN?
Updated: Jan 30, 2021
The Emergence of ‘Stacks’
The invention of the Internet created history. The internet led to the development of more and more technologies and devices, which created a global market where anyone could sell their services and products. Businesses started going online, which led to the rise of the web development industry. Initially web development was only bound to simple web pages, but due to constant evolution on the Internet, there was an advent of complex web applications that can perform multiple functions.
Web application is stacked with multiple layers for technologies: front-end (user-facing technology), back-end (server-side technology) and database (data storage technology). These multiple layers are collectively referred as ‘stack’. Stack was first put forward during the launch of the LAMP stack, which was the first open-source full-stack development bundle constituting the capabilities of Linux OS, Apache Server, MySQL DB, and PHP programming language. Succeeding the LAMP stack, came into existence the MEAN and MERN stacks.
MongoDB uses Ad-hoc queries that are short-lived & depend upon variables. Every time a query is executed values is different and dependent on the value of the variable in the question. MongoDB has a range of indices and features with language-specific sort orders that support complex access patterns to datasets. For disaster management purposes or in cases of failures, MongoDB databases multiple times. In MongoDB, large datasets are stored in an equal distribution of clusters known as shards; this process is called sharding. Sharding helps to bring out horizontal scalability as each shard behaves as an individual database. MongoDB can handle multiple simultaneous read and write requests with its concurrency control and locking protocols.
Node JS & Express JS
Node JS and Express JS collectively form a backend tier of 3-tier MERN architecture. Express JS has powerful tools and models for URL routing (matching an incoming URL with a server function) and handling HTTP requests and responses. By making XML HTTP Requests (XHRs) or GETs or POSTs from your React JS, you can connect to Express JS functions that power your application.
React is an open-source frontend library for User Interface development used for SPA (Single Page Applications) and Mobile Applications. React JS has component-based architecture which encourages creation of reusable UI components that represent data that changes over time. Here each component represents a view or a part of a view on a webpage.
Document Object Model (DOM) is an interface that treats a document as a tree structure. DOM manipulation and updating takes a lot of time. In React JS instead of DOM, Virtual DOM is used. Virtual DOM is a lightweight copy of a DOM, much faster than DOM. React JS supports one-way data binding, data can only flow from parent to child components using read-only props.
Why is MERN popular?
In recent times, MERN has been popular full stack framework for multiple reasons:
By supporting Model-View-Controller (MVC) Architecture, MERN makes frontend to backend server-side development process flow smooth.
Few proponents of MERN attribute its success to use of Virtual DOM. Virtual DOM is a lightweight copy of a DOM that can be manipulated and updated faster compared to the actual DOM which makes applications work faster.
MERN supports one-way data binding which means one can change UI only after changing the model state. This one-way data binding proves to be efficient for managing larger projects.
Pre-built extensive suite of testing tools available in MERN stack makes testing easy.
Top brands using MERN
UberEats: Food delivery app 'UberEats' made use of MERN stack to revamp their restaurant dashboard with intent to make it more appealing and engaging.
Instagram: Instagram uses MERN stack to help them achieve faster start-up time and more appealing user experience .