The Trend of Micro-frontends: More Hype Than Practical Utility?

Modern software development is becoming more complex. The scope and scale of applications are becoming bigger, both in terms of functional and non-functional requirements. For instance, application teams want to release new innovations to their users at an accelerating pace, highly feature-rich user interfaces have become a norm in many industries, customers expect peak application performance even at significantly high traffic/load, security challenges are becoming more critical, and so on. At the same time, new software paradigms, programming languages and frameworks, and development tools are continuously evolving. One such new trend that is gaining popularity in recent times is the Micro-frontend Architecture.[siteorigin_widget class=”thinkup_builder_divider”][/siteorigin_widget]

A short primer on micro-frontends

Micro-frontends were introduced to bring the benefits of the microservices paradigm to the frontend. The core concept of micro-frontends is to decompose a monolith frontend into autonomous, small frontends that interact as independent services, and generally organized around specific business capabilities. The major benefits of this approach include simpler, decoupled code that can be managed and maintained more easily; incremental and independent releases that can frequently keep improving the user experience; and more decentralized workload planning & execution through autonomous teams.

In general, each micro-frontend serves as the interface for a specific feature or business capability, is decoupled from the others, and independently built, tested and released. Moreover, separate development teams may work on the different micro-frontends depending on the scale and complexity of the application. Furthermore, each team might deploy a different technology or framework to build their respective micro-frontends. For instance, Team A working on Micro-frontend 1 might use Angular while Team B working on Micro-frontend 2 might use React.

The micro-frontend architecture enables strong abstractions, enhanced fault isolation and resilience, improved testability, contract-based programming, and a strong focus on automation. Additionally, it ensures that applications are built in a future-proof manner so that new technologies and frameworks can be easily deployed in the future. Frameworks like Bit, Module Federation, Luigi, Piral, Podium, PuzzleJS, Qiankun, Single-Spa, SystemJS, and others offer an easy way for micro-frontend adoption.

The practical challenges of micro-frontends

While the micro-frontend architecture may be conceptually sound, it has its own practical inefficiencies and limitations. The most important challenge is the added complexity and administrative overhead that are caused due to the need for building, deploying and managing a large number of entities (micro-frontends) instead of just one (front-end.) For instance, testing across the application, debugging complex issues and SEO optimization often needs additional efforts and tooling. Moreover, the consolidation of multiple micro-frontend units into a cohesive interface can often be challenging.

Secondly, there is the fundamental point of how micro should be the micro-frontend. There is no uniform view on this, and it is not uncommon to see different teams within the same company building micro-frontends vary significantly in scope and size. While factors like functionality, ownership, reusability, and the overall application size are generally considered for determining the boundaries of each micro-frontend, this is still an area that many software architects and senior developers find difficult to implement.

In theory, the micro-frontend approach is intended to deliver superior application performance but this is not always observed in practice. In reality, the way the entire system is designed, including the interaction of the front-end with the backend, is the main driver of performance – irrespective of whether the micro-frontend style is adopted, or not. For instance, the initial load time has a high dependency on the specific composition approach used in the micro-frontend application, and many development teams do not get this right in practice.

In general, web applications that are built using multiple front-end frameworks face the challenge of increased payload size because the browsers need to fetch more data, thereby slowing the application loading time. Furthermore, user interface inconsistencies, duplication of common dependencies, routing complexities, and issues with certain elements like embedding iframes, are often observed in the micro-frontend approach. While development tools and techniques are available to address some of these challenges, most of them are still in the early stages of the maturity cycle, and may not deliver optimal results.

When should micro-frontends be adopted? And when not?

The adoption of micro-frontends is best suited under the following conditions.

  • The applications that need to be developed are large, or need to be massively scaled-up over time (e.g., large ecommerce sites, or streaming platforms), or may involve multiple frontend development teams.
  • Strong DevOps capabilities and structures, especially automated pipelines, are already in place.
  • The organization has experienced software architects, especially with the skills to address (what is often called) the micro-frontends decisions framework of definition, composition, routing and communication.

However, many real-life scenarios fall outside of the above conditions, and the adoption of the micro-frontend approach may lead to sub-optimal results. For instance, the engineering teams in many small- and medium-sized companies are numerically small, coupled with skills only in select frameworks. Building applications through micro-frontends may be practically difficult, or even counter-productive, in such organizations. The decision to deploy this architectural style must be based on actual utility and practical feasibility, and after careful consideration of the challenges and limitations.

The selection of architecture styles and design patterns are generally based on trade-off decisions, and the micro-frontend architecture is no different. For instance, while the implementation of the micro-frontend architecture may create more autonomous teams, it also increases the risk of silos within the engineering organization. Similarly, while it enables shorter release cycles, it also introduces higher release risks because defects tend to surface during the application run-time, instead of the build-time or in the continuous integration pipelines. Furthermore, patterns and anti-patterns that are specific to this architectural style are still open items of discussion.

Finally, micro-frontends are not a silver bullet, and may not be suitable for every type of application, including the microservices-based ones. The decision to implement this architectural style must be driven by the specific needs of the applications, and the dynamics of the engineering teams. In reality, the modern practice of component-based frontend development using a mature framework (say, Angular or React) often delivers the optimal value that many web applications need today, and in the foreseeable future.

Share this article.