Open In App

What are Micro Frontends? Definition, Uses, Architecture

Micro front-end refers to a design pattern in software architecture where the user interface (UI) of a web application is broken down into smaller parts for more manageable parts known as micro front-ends. Each micro frontend is a self-contained module and is responsible for rendering a specific section of the overall user interface.



The concept of micro frontend comes from microservice architecture. Basically, Microservice is an architecture in which an application is decomposed into small independent services that can be worked independently and combined with a fully working service by combining all the services. Let’s understand it in more detail before knowing What is Micro Frontends.

What are Microservices?

In software development, a microservice is an approach to dividing a project into small segments to handle them independently. It generally helps us to modify small parts of a project which can be easily created or modified. This approach can make a better solution to a problem and many developers can work simultaneously, it is useful to create a scalable project and can have many developers work simultaneously. Microservices are used in app development sed in the backend whereas micro front end is used in front-end applications also used front-end languages like react, vue, angular, etc.



What are Micro Frontends?

If we talk about Micro Frontends, they are small components from different languages and can have different directories/projects that can be combined into a single website/webpage. These components work separately and can create a webpage using all the components. We can create each of the components and integrate it into the letter stage.

There are many uses and advantages of using Micro Frontends. Let’s understand them one by one

Advantages of Micro Frontend

Micro Frontend Architecture

Micro frontend architecture is an approach to building web applications as a collection of small, self-contained frontend modules each responsible for a specific part of the user interface. These micro frontends can be developed, tested, and deployed independently, allowing for greater flexibility, scalability, and maintainability in large and complex web applications.

The architecture of Micro Frontends typically revolves around the following key components:

Characteristics of Micro Frontend Architecture

Difference between Monolithic Architecture and Micro Frontend Architecture.

Aspect

Monolithic Architecture

Micro Frontend Architecture

Overview

Single-tier architecture where all components are tightly coupled and deployed together as a single unit.

Modular architecture where frontend components are independently developed, deployed, and maintained.

Granularity

All features are bundled into a single code. Large

Fine-grained, with each feature or component developed and deployed separately.

Technology Stack

Relies on a single technology for the entire application

Allows the use of different technology stacks for different frontend components.

Scaling

Scaling requires scaling the entire monolith

Scaling in specific component independently.

Development

It can be slow due to large size and complexity

Fast development cycle, team can work independently

Types of Micro-frontends

1. Monorepository

In this, the application can be found within the same directory or repository. We can create a global directory and include all the components in it to use them. It is useful in small types of applications.

Advantages

2. Multirepository

In this, components can be found outside the directory. Different components with different languages can be found in the different repositories. It is useful in larger size of projects which need clarity and reliability.

Advantages

3. Metarepository

These are the combination of the above two repositories. This project is divided into different repositories and one of those repositories can have more than one repository.

Advantages

Conclusion

Micro Frontends represent an example shift in frontend development, offering benefits such as scalability, team autonomy, reusability, and improved maintenance. By breaking down monolithic frontend applications into smaller, self-contained modules, teams can increase in development, enhance flexibility, and adapt to changing requirements more effectively. However, adopting Micro Frontends requires careful planning, design, and implementation to realize its full potential and reap the benefits it offers in modern web development.


Article Tags :