Building Micro Frontends

Building Micro Frontends

Good frontend development is hard. In this article I will describe a recent trend of breaking up frontend monoliths into many smaller, more manageable pieces, and how this architecture can increase the effectiveness and efficiency of teams working on frontend code.

Over the last couple of years, we have learned microservices architecture while much has been written about microservice architectural style of building server-side software Microservices vs Monolith Architecture and Distributed Transactions Patterns In Microservice Architecture now we are struggling with monolithic frontend codebases.

What is Micro Frontend?

Micro Frontend means approaching front-end development process of web apps with the concept and idea of microservices.The idea of a micro frontend is to break the user interface into pieces by product function and make each of those pieces an independently deployable frontend codebase. While the divisions and method for breaking code up vary, it’s helpful to imagine a specific example.

No alt text provided for this image

In a micro frontend architecture, we could break the app into three different codebases, each owned by a team responsible for one specific feature.This architecture would allow the Gold Team to deploy a new Banner interface on Monday, the Green Team to deploy updates to the Related Items on Tuesday, and the Blue Team to add Product Detail on Wednesday—all without affecting any other on the page.

Integration approaches

Given the fairly loose definition above, there are many approaches that could reasonably be called micro frontends. Generally there is a micro frontend for each page in the application, and there is a single container application, which:

  • Renders common page elements such as headers and footers
  • Addresses cross-cutting concerns like authentication and navigation
  • Brings the various micro frontends together onto the page, and tells each micro frontend when and where to render itself.

Server-side template composition

There could be a separate server responsible for rendering and serving each micro frontend, with one server out the front that makes requests to the others. With careful caching of responses, this could be done without impacting latency.

No alt text provided for this image

Why Micro Frontends?

Incremental upgrades

Freedom to make case-by-case decisions on individual parts of our product, and to make incremental upgrades to our architecture, our dependencies, and our user experience.

Simple, decoupled codebases

The source code for each individual micro frontend will by definition be much smaller than the source code of a single monolithic frontend. These smaller codebases tend to be simpler and easier for developers to work with.

Independent deployment

Independent deployability of micro frontends is key.We should be able to deploy each micro frontend with very little thought given to the current state of other codebases or pipelines.

No alt text provided for this image

Autonomous teams

Each application should be owned by a single team.Teams can have full ownership of everything they need to deliver value to customers, which enables them to move quickly and effectively.

No alt text provided for this image

Disadvantages of Micro Frontends

Every architectural style comes with tradeoffs, and micro frontends are no different.While they solve some thorny problems- especially for large, enterprise software teams-they introduce a new set of issues as well.

Duplicate Dependencies

If we imagine having three frontend apps that all load their own frontend framework, we can see how quickly duplicate dependencies can slow down our app. This is even more of a problem with micro frontends than with backend microservices because every dependency must be passed over the internet to your users rather than simply compiled for on the server.

Siloed Teams

Because micro frontends encourage business-case boundaries between elements, they could contribute to an undesirable “us vs. them” culture. If we allow teams to work with different frontend frameworks or design patterns, we might also introduce unnecessary friction when developers want to move from one unit to another.

Rigid Boundaries

Finally, making our boundaries completely separate applications makes them much harder to move them later. This might be a good thing in a large, established application, but it could unnecessarily slow the development of a new app that’s rapidly changing.

The Next Steps

Micro Frontends is a great component model for transforming the way we build software, deliver progressively and frequently. For large organizations, this can be a game-changer that facilitates continuous delivery and for fast-growing startups, it presents a bankable choice as a scalable and flexible architecture.

Part 2 Micro Frontend Deep Dive With Example of this series, I will explain most popular microfronted frameworks used in fronted development environments.

References

Micro Frontends – Revolutionizing Front-end Development with Microservices

Building Micro Frontend

Building Micro Frontend with Server Side Microservices

How We Build Micro Frontends

How We Build MicroThe Strengths and Benefits of Micro Frontends Frontends

Outstanding series of articles man. Thank you for this.

回复

要查看或添加评论,请登录

Miah Md Shahjahan的更多文章

  • MCP as a Trading Layer

    MCP as a Trading Layer

    In 2022, When I began working on the FIX Gateway and later the Market Data Feed for a trading engine, the AI product…

  • Understanding Distributed System

    Understanding Distributed System

    Most engineering books or blogs deep dive right into the heart of some complex topics around distributed systems which…

  • Understanding the ins and outs of distributed systems

    Understanding the ins and outs of distributed systems

    Knowing about the ins and outs of distributed systems is key for both backend engineers and anyone working with…

  • Understanding Chaos Engineering

    Understanding Chaos Engineering

    Enterprise software systems have become more sophisticated, relying heavily on distributed components like cloud…

  • Database Separation in Microservices: Scaling Resilience

    Database Separation in Microservices: Scaling Resilience

    In modern software development, the microservices architecture has gained immense popularity for its scalability…

  • Building Resilient Distributed Systems: Considerations and Best Practices

    Building Resilient Distributed Systems: Considerations and Best Practices

    Now a days navigating the complexities of modern infrastructure requires resilience, especially in distributed systems.…

  • Integrating Multiple Databases Seamlessly using GoLang with PostgreSQL

    Integrating Multiple Databases Seamlessly using GoLang with PostgreSQL

    In today's data-driven landscape, many applications rely on multiple databases to store different types of information.…

    5 条评论
  • Understanding Generics in Go

    Understanding Generics in Go

    Go, a statically-typed and efficient programming language, has gained significant popularity due to its simplicity and…

  • Concurrency Patterns in Go | Part 2

    Concurrency Patterns in Go | Part 2

    In the part 1 we learned that channels are playing a crucial role in facilatating communication and sychronization…

  • Concurrency Patterns in Go | Part 1

    Concurrency Patterns in Go | Part 1

    Go provides several powerful concurrency patterns that can be used to design efficient and scalable concurrent…

    2 条评论

社区洞察

其他会员也浏览了