Vanta Logo
SPONSOR
Automate SOC 2 & ISO 27001 compliance with Vanta. Get $1,000 off.
Published
6 min read
Up to date

Trevor I. Lasn

Staff Software Engineer, Engineering Manager

Micro Frontends: The LEGO Approach to Web Development

Explore the concept of micro frontends in web development, understand their benefits, and learn when this architectural approach is most effective for building scalable applications.

Micro frontends are an architectural approach to frontend development that extends the concept of microservices to the frontend layer. Instead of building a single, monolithic frontend for a web application, we break it down into smaller, more manageable pieces that work together seamlessly.

Think of it like constructing a complex LEGO city, where different teams can work on different buildings or sections independently, using their preferred LEGO sets (technologies), but all pieces fit together to form a cohesive whole.

Header (React)Product Catalog(Vue.js)Product Details(Angular)Shopping Cart(React)Checkout(Vue.js)E-commerce Micro Frontend Architecturetrevorlasn.com

Key Characteristics of Micro Frontends

  1. Frontend Integration: Different parts of the application are developed independently.

In a micro frontend architecture, the application is split into distinct features or sections, each developed and maintained separately. These parts are then integrated at runtime to create a cohesive application.

HeaderNavigationContentIntegrated Apptrevorlasn.com

This approach allows teams to work independently on different parts of the application, promoting faster development and easier maintenance.

  1. Technology Diversity: Each team can choose the best tool for their job.

This diversity can lead to better performance, as each team can optimize their component using the most suitable tools and frameworks.

ReactVue.jsAngularUnified Applicationtrevorlasn.com
  1. Team Autonomy: Cross-functional teams work on their own missions.

Each team in a micro frontend architecture is responsible for a specific feature or section of the application, from development to deployment. This autonomy enables faster decision-making and more efficient workflows.

Team ADesignDevelopDeployTeam BDesignDevelopDeployTeam CDesignDevelopDeploytrevorlasn.com
  1. Scalability: New teams and features can be added without disrupting existing parts.

Micro frontends make it easier to scale applications by allowing new features to be added as separate components. This approach minimizes the risk of breaking existing functionality when introducing new elements.

Feature AFeature BFeature CNew FeatureFuture Featuretrevorlasn.com

This scalability ensures that the application can grow and evolve over time without requiring a complete overhaul of the existing system.

  1. Unified Experience: All parts come together to create a seamless user experience.

Despite being developed independently, micro frontends are designed to work together harmoniously, providing users with a consistent and cohesive experience.

Header (Team A)Navigation(Team B)Content(Team C)Seamless User Interfacetrevorlasn.com

The key to achieving this unified experience lies in establishing clear design guidelines, shared components, and effective integration strategies across all micro frontends.

Historical Context

The concept of micro frontends emerged around 2016 as an extension of microservices architecture to the frontend.

2011MicroservicesEmerge2016Micro FrontendsConcept Introduced2019WidespreadAdoption BeginsPresentMature Toolingand Practicestrevorlasn.com
  • 2011: Microservices architecture gains popularity in backend development.
  • 2016: The term “Micro Frontends” is coined, applying microservices principles to frontend.
  • 2019: Widespread adoption begins as more companies see the benefits.
  • Present: Mature tooling and best practices have emerged.

When to Use Micro Frontends

Micro frontends are particularly beneficial in the following scenarios:

  1. Large, complex applications

Micro frontends excel in large-scale applications where the codebase becomes too complex for a single team to manage effectively.

Consider a comprehensive banking platform that includes features like account management, investments, loans, and customer support.

Account ManagementInvestmentsLoansCustomer SupportBanking Platformtrevorlasn.com

In this scenario, each major feature can be developed as a separate micro frontend, allowing teams to work independently and manage complexity more effectively.

  1. Multiple teams working on the same product

When multiple teams are involved, micro frontends allow each team to work autonomously, reducing coordination overhead and conflicts.

Team A: Product CatalogTeam B: CartTeam C: CheckoutTeam D: User ReviewsE-commerce Platformtrevorlasn.com

A large e-commerce platform where different teams are responsible for specific areas of functionality. Each team can develop, test, and deploy their part of the application independently, speeding up the development process.

  1. Need for frequent, independent updates

Micro frontends shine when different parts of the application need to be updated at different rates without affecting the entire system.

A news website where the content, advertising, and user interaction components have different update frequencies.

Content (Daily Updates)Advertising(Hourly Updates)User Interaction(Weekly Updates)News Websitetrevorlasn.com

This structure allows each component to be updated at its own pace without requiring a full site deployment.

  1. Desire to use different technologies for different parts of the application

Micro frontends allow teams to choose the best technology for each part of the application, enabling technological diversity.

A customer relationship management (CRM) system with different technological needs for various components.

Contact Management(React)Data Visualization(D3.js)Reporting Engine(Vue.js)CRM Systemtrevorlasn.com

This approach allows each component to use the technology best suited for its specific requirements.

  1. Legacy system migration

Micro frontends can facilitate the gradual migration of legacy systems by allowing piece-by-piece modernization.

Example: Modernizing a legacy enterprise resource planning (ERP) system.

Legacy Inventory(PHP)New HR Module(React)Legacy Accounting(Java)New Analytics(Vue.js)ERP Systemtrevorlasn.com

This approach allows the organization to gradually replace parts of the legacy system with modern micro frontends, reducing risk and spreading the migration effort over time.

Challenges of Micro Frontends

While micro frontends offer numerous benefits, they also come with their own set of challenges that organizations need to consider carefully:

Challenge
Increased ComplexityAdditional tooling and infrastructure required
Multiple codebases, build processes, and pipelines
More challenging debugging
Performance OverheadIncreased initial load times
Potential duplication of dependencies
Consistency ChallengesDifficulty maintaining consistent UX
Need for coordinated design and shared components
Integration ComplexityChallenging runtime integration
Complex state and inter-frontend communication
Team CoordinationNeed for coordination despite team autonomy
Careful management of standards and interfaces
Testing ChallengesComplex end-to-end testing
Need for comprehensive integration testing
Versioning and DeploymentChallenging version management and compatibility
Need for sophisticated CI/CD pipelines
Learning CurveNew tools and techniques to learn
Conceptual shift for teams used to monoliths

The decision to adopt micro frontends should be based on a careful analysis of the project requirements, team capabilities, and long-term goals. For many smaller projects or teams, a well-structured monolithic frontend might still be the most efficient and manageable approach.

If you found this article helpful, you might enjoy my free newsletter. I share developer tips and insights to help you grow your skills and career.


More Articles You Might Enjoy

If you enjoyed this article, you might find these related pieces interesting as well. If you like what I have to say, please check out the sponsors who are supporting me. Much appreciated!

Javascript
5 min read

Recursion Explained In Simple Terms

Understanding recursion through real examples - why functions call themselves and when to use them

Nov 22, 2024
Read article
Javascript
5 min read

Why Browsers Block CSS File Modifications

Understanding CSS Object Model (CSSOM), browser security and practical alternatives for dynamic styling

Oct 25, 2024
Read article
Javascript
4 min read

JavaScript Import Attributes (ES2025)

Understanding the new import attributes syntax and why we can't rely on file extensions alone

Nov 10, 2024
Read article
Javascript
4 min read

Understanding Bitwise Shifts in JavaScript: << and >>

A practical guide to left and right shift operators in JavaScript

Nov 12, 2024
Read article
Javascript
5 min read

Precise Decimal Math in JavaScript with Fraction.js

How to handle exact decimal calculations in JavaScript when floating-point precision isn't good enough

Nov 16, 2024
Read article
Javascript
6 min read

AggregateError in JavaScript

AggregateError helps you handle multiple errors at once in JavaScript. This makes your code easier to manage and more reliable.

Sep 2, 2024
Read article
Javascript
7 min read

WeakRefs in JavaScript: Explained In Simple Terms

Understanding how WeakRef helps manage memory in JavaScript

Jan 7, 2025
Read article
Javascript
3 min read

navigator.clipboard - The New Asynchronous Clipboard API in JavaScript

Copy and paste text, images, and files using the new navigator.clipboard API

Dec 7, 2024
Read article
Javascript
3 min read

JavaScript's &&= Operator: Understanding Logical AND Assignment

Use the &&= operator to safely update truthy values while preserving falsy states

Nov 5, 2024
Read article

Become a better engineer

Here are engineering resources I've personally vetted and use. They focus on skills you'll actually need to build and scale real projects - the kind of experience that gets you hired or promoted.

Many companies have a fixed annual stipend per engineer (e.g. $2,000) for use towards learning resources. If your company offers this stipend, you can forward them your invoices directly for reimbursement. By using my affiliate links, you support my work and get a discount at the same!


This article was originally published on https://www.trevorlasn.com/blog/micro-frontends-what-they-are-and-when-to-use. It was written by a human and polished using grammar tools for clarity.