HomeCategoriesAll Tags

Microfrontends Yay or Nay

Is microfrontends really a thing to get started and choose it for a production ready case?

Introduction

Micro Frontends is an approach that extends the concept of microservices to frontend development.

So similar to microservices, front-end is separated into different sections such that each section is an independent front-end and can have it's own technology, tools, deployment. Finally, all the front-ends are combined as needed by let's say by a parent front-end or master front-end.

Advantages

  • Avoid a "Frontend Monolith" where the frontend layer becomes difficult to maintain.
  • Modularity. Separation of concerns.
  • Independent development, testing, deployments and updates.
  • Team autonomy. Flexibilty of tools and technology. Thus, finding and scaling the human resources up or down is easier.
  • Incremental feature roll out is easier as you need to work only on a specific component, not the entire system.
  • Unit testing is improved as components can be tested in isolation.
  • Failures can be isolated. If one part fails it doesn't bring down the entire application.

Disadvantages

  • Increased complexity of architecture.
  • Increased challenge of managing consistency across the apps.
  • Operational overhead of managing multiple package versions and their deployments.
  • Debugging can be difficult.
  • Overhead for E2E Tests on local machine since every frontend needs to be run on different ports.
  • Shared libraries (e.g. base-ui) need to be imported by every micro frontend again.
  • Overhead of loading various small bundles for each front-end might impact the performance.

Conclusion

It's theoretically a good concept on paper, but lacks practical implementation challenges.

Microservices works well for backend but on front-end everything ultimately falls under one umbrella so we always need a master front-end. Hence, instead of microservices like concept, it becomes more of a master slaves kind of architecture.

These are my thoughts on the subject. Thanks for reading along. Let me know your feedback/suggestions in the comments.

- Ayush 🙂