How Micro Frontends are being Implemented in 2020: A Survey
Tags: microfrontends, webdev, javascript, architecture
Published: 2020-09-17 20:11:34

In June I've written a post regarding the "[State of Microfrontends](https://blog.bitsrc.io/state-of-micro-frontends-9c0c604ed13a)". This article focused on the technical solutions available and presented some key players as well as a bit of background info. Recognizing that the user side was lacking I published a small survey.

I'm happy that after more than two months and quite some tweets the survey has been closed. The results are now evaluated and I'll try to present them here in the best form possible. Overall, over 300 answers have been registered.

If you think this survey deserves a more suitable (i.e., larger, better prepared) follow up then let me know in the comments. **Any contribution is much welcome.**

Let's get right into it!

## Who Participated

From the answers, it is clear to see that the majority is planning to or already working with microfrontends.

While a fifth is only at the start of their journey with microfrontends (and thus potentially found the article/survey) more than a third feel already fully equipped to fully leverage microfrontends.

![Participant Knowledge (1 beginner — 5 expert)](https://miro.medium.com/max/700/1*cfxFe6YP2SRD4q6aG24xTw.png)

Nearly three out of four participants read posts and articles about microfrontends on a regular frequent basis. This matches very well with the participants' knowledge.

![Frequency of Information Consumption](https://miro.medium.com/max/700/1*i7nwuLb3-WsCjk8Ya8Vhew.png)

What's the background of these participants? Looking at the number of employees of the participants' companies we see that it's quite equally spread. Sure, a third works at quite large corporations with more than one thousand employees, but another third works at smaller companies with less than a hundred workers.

![Number of Employees at the Participants' Companies](https://miro.medium.com/max/700/1*OVKqmQnOWrF48kro1skNJA.png)

Especially that every ninth participant works at a company with less than 10 people is remarkable. These are either very special projects or agencies working for larger companies. In my case, it's the latter.

A potentially better indicator about the participants' background is the number of frontend developers at one of the microfrontend projects. While there is still a significant portion with more than 100 frontend developers (okay, that really is something requiring microfrontends) four-fifths have less than twenty frontend devs.

![Number of Frontend Developers at the Participants’ Microfrontend Project](https://miro.medium.com/max/700/1*W1aIWjC7CB998SEc5YT3Zg.png)

There is no strict boundary when microfrontends make sense from a team size point of view. Sometimes two developers may already make it sufficient, sometimes even larger workforces play together perfectly fine without additional modularization.

In the end its a combination of several factors incl. the problem to solve, the organizational structure, the workflow, the communication paths, and the application's architecture.

For a first-hand experience of a company taking into consideration these different factors, [read here](https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc).

## Frameworks or Libraries

So let's get technical. One of the core questions to answer in this survey was if the current technology landscape is fully known *and* appealing. Does it solve the problem sufficiently? What is potentially lacking?

Microfrontends are *not* for everyone. While creating or maintaining a (single) microfrontend should be as simple and straight forward as possible, setting up a whole microfrontend solution is among the most difficult tasks in frontend engineering right now. There are just many pieces to keep in mind. And it all starts already with a basic decision: *How* to do it?

The most basic question is: Do you want to use microfrontends as a SPA from the client-side, or classically server-side rendered? Sometimes, microfrontends are also stitched together in a joint build-process (like in [Bit.dev](https://bit.dev/)'s example case above). There are even variations or combinations of the three. Two thirds, however, agree that the client-side in form of a SPA is the way to do it.

![Used Approaches for Microfrontends](https://miro.medium.com/max/700/1*y1hsI5P6S9FqRyLGjugXuw.png)

It would be interesting to correlate this with the individual participant's project's industry. For instance, I believe that for webshops or in general eCommerce solutions in general client-side is the least used solution. Here, server-side fully shines. For portals and tools, single-page apps are certainly the way to go.

Likewise, asking for the use of frameworks we see that less than half of the participants used an existing framework. Potentially, the number of "home-grown" solutions that are just perfectly aligned with the project's needs is still large.

![Use of Existing Frameworks](https://miro.medium.com/max/700/1*q7SIPULDtrLnRZkDhl8HCQ.png)

One reason for this is the relative age or youth of microfrontends as an architecture pattern. Most projects already started two or three years ago when no real solutions have been on the market.

This also can be seen by the provided ratings of the available solutions. Its a near perfect Gaussian (normal distribution). The essence is that most people regard the currently available solutions as average or mediocre. This, of course, takes only their known solutions into consideration. We would need to dive into correlations to find out how they rate the different frameworks.

![Rating of Existing Solutions (1 poor — 5 great)](https://miro.medium.com/max/700/1*I-bUIXEbppJ9xDsoPAQxYg.png)

So what frameworks do the participants know? From the given list unsurprisingly [Single SPA](https://single-spa.js.org/) is the most known solution. [Mosaic](https://www.mosaic9.org/) from Zalando comes in second place. Potentially biased through my own distribution [Piral](https://piral.io/) is also already known to every fifth participant of the survey.

![List of Known Frameworks](https://miro.medium.com/max/700/1*VJqtsW-jS_RjlSb9tO4c_g.png)

This does not include [tools and platforms that manage independent components](https://bit.dev/), even though they, essentially, offer a compile-time implementation of Micro-frontends (and are not only useful as a helper tool for consistent UI, code reuse, etc.).

![Example: Bit a tool and platform for sharing and managing independent components](https://miro.medium.com/max/700/1*T6i0a9d9RykUYZXNh2N-DQ.gif)

The list of frameworks also contained some solutions that are actively marked as outdated or deprecated. This is also one indicator of this fast spinning market that we see here. Microfrontends are still complex and young technology.

Asking the participants about other frameworks or techniques they use we get:

* Pure distribution standards and technologies such as **AMD**, **SystemJS**, or **iframe**s.
* Architecture decisions such as **vertical/horizontal split**, **client/edge-side**, or **server-side composition**.
* Tooling based solutions, e.g., **Webpack Module Federation**, **React + Webpack + React Suspense + Dynamic Module Loading + Lerna + Yarn Workspaces**.
* Other frameworks/solutions such as **UmiJS**, **icestark**, or **feature-hub.io**.

In general, though, the list above fits well. Especially looking at the other solutions such as [UmiJS](https://umijs.org/) or [icestark](https://github.com/ice-lab/icestark) it feels that the Asian market is somewhat misrepresented in this survey. Luckily (or unfortunately), it seems that most participants also did not come from that region. For a follow-up survey help to cover the trends worldwide would certainly be much appreciated!

## Why Microfrontends

Well, this is a great question, right? After all, wouldn’t a monolith or whatever we built 3 or 4 years ago do it? There *must* be some (hopefully business-relevant) reasons for using microfrontends.

> Ability to use different frontend frameworks but still having SPA UEX.

Quite often we hear that microfrontends are especially great for SPAs as they break the walled garden of a single technology. Is that true? Is the use of multiple technologies really the driver here?

![Number of Frontend Technologies](https://miro.medium.com/max/700/1*bh-loQ_GjY7rBmhZA63ORw.png)

It does not seem so. Certainly, being able to use multiple technologies is nice and quite often demanded, but we should be cautious not to overload the user's browser with too many technologies. Also, who will take care of maintenance here? How to keep up with updates to all the used technologies? More than half just use a single technology and have fewer problems.

Independent, if we use a single or multiple technologies — what should be our primary focus here? Is there a single technology that makes some sense to focus on?

![Preferred Frontend Technology](https://miro.medium.com/max/700/1*JXNwtbXKSxXSZo-FC95kYg.png)

It turns out React is also strong in the microfrontend space. Almost 60% would settle on React. Angular and Vue are tied. This is a bit surprising, as especially Angular is known for being the basis of massive apps.

However, really making a scalable microfrontend solution with Angular is — as it turns out — not so easy. This is in contrast to React, which comes with debatable the most composable component model.

Svelte takes the first spot after the glory three. For me personally, this is not a huge surprise. Svelte is great and due to the compile-to-native-functions approach very nicely fitting for microfrontends.

> For our current company architecture, the product is very big and we are trying to implement feature ownership. It is very difficult for instance, when the node modules needs to be updated for everyone. Micro frontend would also ease the QA part.

So if multi-framework is **not** the most desired advantage — what is it then?

![Most Seen Advantages of Microfrontends](https://miro.medium.com/max/700/1*sPuJwr55s5J7u0HldpyIlw.png)

Through the improved modularization, multiple teams can work much better on a single project. In the end, this also reflects in a more rigorous architecture and thus in a better dev experience. The latter, of course, can only be perceived in a large project.

Compared to the quite common monolithic spaghetti a microfrontend solution could be regarded as lightweight and elegant. After all, the different modules **should** all be focused and rather small/minimal.

The comments also respect the team aspect a lot.

> Enabling autonomous teams to work side by side with little coordination

(or to use another good quote here: "*Avoid other teams code*"), which results in

> Faster time to market

due to

> Vertical slices of work

alias "*Partitioning of application complexity along team and domain boundaries.*"

Interestingly, the user experience is also seen as a key factor by a third of the developers. For me personally, this is indeed an interesting feature of microfrontends — allowing not only the development to scale better, but also the user experience to be more progressive, too. However, together with the personalization option these two still form the least of seen advantages.

> Flexibility to compose the application based on user role. Stability in the amount of code that needs to initially be loaded by the client no matter how large the app/feature set grows. Better development across teams. Ability to leverage the same devops tools for new pieces of the front end, which greatly simplifies rolling out new functionality.

## Reasons for Not Using Microfrontends

The survey also had a text field for disadvantages. The most seen ones have been:

1. Complexity (tooling, versioning, UX alignment, …)
2. Performance (bundle size, loading time, …)
3. Multi-framework (knowledge, overhead, …)
4. Lack of standards (foundation, CSS isolation, …)
5. Testing
6. Architecture

One reason why people don't like the currently available solutions is that

> Most frameworks and UI libraries assume they're you're only choice and don't integrate well.

This is certainly right. However, in my opinion this is just the reflection that these frameworks definitely serve different purposes and solve different problems. Nevertheless, some level of interoperability could help here.

There was one longer comment that reflected this pretty well:

> There does not seem to be a lot of standardization here and there was even less when we set out to build our solution 2 years back. We had to build a custom setup based on our needs. We used standards like AMD modules compiled with Webpack, but all the builds and automation had to be very customized. We got to a great place, but took a lot of work to get here.

## Conclusion

Overall, the community seems to be quite happy with the current progress. Despite the obvious issues and complexity of microfrontends in general, progress and use cases seem to advance in the right direction.

What's your opinion? Do you agree or are my conclusions off?