Challenges of Decomposing a Massive Front-End Using Micro-Frontends

Rate this content
Bookmark
Slides

Our web UI application is pretty big - hundreds of people have been actively building it during the past eight years. We started facing scalability issues and technological limitations. We evaluated plenty of options and settled on micro-frontends. This evening we will discuss:

- Differences between various micro-frontend architectures

- Why we made this choice and if it's helpful for you

- What we gained

- What we sacrificed (yes, there are downsides)

- What challenges are still ahead of us

Oleksandr Tryshchenko
Oleksandr Tryshchenko
28 min
08 Dec, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Microfrontends offer a potential solution to frontend engineering problems, improving testing efficiency and allowing for faster development. There are misconceptions about microfrontends, with different approaches such as horizontal and vertical splits. Monorepos are recommended for managing microfrontends. Data management and side effects can be handled through various approaches. Building microfrontends without a monorepo can be challenging, but it depends on the scale of the application. Trust in people and implementing a registry of components help avoid duplication. Tools like Module Federation and NX are useful for managing microfrontends.

1. A Dream, Pager Duty, and Microfrontends

Short description:

It's a nice, sunny day. You're gliding across the fjords. Water consumes you. You take a look at your phone and see a pager duty notification. You understand the problem, but it's caused by someone not even a frontend engineer. You fix it, but encounter issues. Eventually, you merge your pull requests. Microfrontends is a potential solution to this problem.

It's a nice, sunny day. You're gliding across the fjords. The nice sun rays fall on the lush forests and those fjords. You are dreaming to have this vacation for a long time. You are truly happy until something gets wrong.

Water consumes you. You lose control. You don't understand what's happening until you wake up. It's been a dream. It's been a bad dream and something has clearly woken you up. You take a look at your phone and you see that it is a pager duty notification. You have a duty to do.

Annoyed, you wake up. You stand up and lazily go to your computer to see what has happened. After some minutes of looking into the issue, you understand what the problem is. Nevertheless, you are extremely annoyed that it's caused not even by your team, but somebody who is not even a frontend engineer.

You hit the table because you're angry. You forget you have a kid who is woken up by your anger and now you have to explain your son why your father, Keith's father, has to fix a mobile phone validation library at night. You do the fix. You open the pull request, which takes 40 minutes to build. You make a coffee while you wait, and in the end instead of a happy green checkmark, you get a red cross.

Wakey test again. You click the restart button. You finish your cold tea to see your green checkmark. You merge your pull requests. You can go sleep for a couple of hours until you're going to wake up and do more job.

It's an example of a combination of a technological problem and an organizational challenge. It shouldn't have happened. Nevertheless, it's there. Microfrontends is one of the potential solutions to address this problem.

2. Microfrontends and Communication

Short description:

Today we are going to talk about microfrontends. We will share experiences from different companies and dispel stereotypes surrounding this topic. When discussing ideas in a group, the conversation often expands and deviates from the original plan. Many people can relate to this, as it can be challenging to effectively communicate and make decisions in larger groups. This concept applies not only to software development but also to other areas, such as politics.

Thank you all for coming here. My name is Alex, and today we are going to talk about microfrontends. I was fortunate or fortunate enough to work in three companies which did microfrontends. Those were fairly different companies, and they wanted to share their experience. How did they do it? Also, dispel some stereotypes which surrounds the topic of microfrontends in general.

Let's talk about your company. You're working and you get an idea. You want to do something very straightforward, very simple, very tangible, and it's going to have very predictable and clear output. Seems easy, right? Let's do X and we're going to get Y. Very straightforward. But no, there is a guy with opinions, and now you have to convince him how you're going to do this. And at least his point makes sense, like, understand, okay, I see where you're coming from. Let's have a chat. Unless discussion expands. Expands in dimensions you didn't envision at first. And the further it goes, the more it deviates from the place it started until eventually it's gone.

Please raise your hands who can relate to the story. Many people. And people who are sitting around you, people who are part of those calls, they don't really want to be there. They also have life to live and they have kids who don't want to know about phone libraries. There is a lot of research about this. It's not a bleeding-edge subject. There was Fred Brooks. He was an engineer and engineering manager, like, many years ago, before many of us were even born. And he wrote a book. The book is called the Mythical Man Mouth, where he describes the concept of people interacting on scale. And the bigger the group is, the harder it is for people to effectively communicate and make decisions. There are similar concepts and I would say that it's credible enough to make our assumptions on this. And it also applies to different spheres of our life. If you will take a look at politics, for example, countries which are like deeply decentralized, they tend to be more effective in managing themselves.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
Do you have a large product built by many teams? Are you struggling to release often? Did your frontend turn into a massive unmaintainable monolith? If, like me, you’ve answered yes to any of those questions, this talk is for you! I’ll show you exactly how you can build a micro frontend architecture with Remix to solve those challenges.
Monolith to Micro-Frontends
React Advanced Conference 2022React Advanced Conference 2022
22 min
Monolith to Micro-Frontends
Top Content
Many companies worldwide are considering adopting Micro-Frontends to improve business agility and scale, however, there are many unknowns when it comes to what the migration path looks like in practice. In this talk, I will discuss the steps required to successfully migrate a monolithic React Application into a more modular decoupled frontend architecture.
Micro-Frontends With React & Vite Module Federation
React Advanced Conference 2023React Advanced Conference 2023
20 min
Micro-Frontends With React & Vite Module Federation
Top Content
From my experience one of the hardest things is to share information between microfrontends, so in this talk I would like to explain various ways on how to share a design system to ensure uniformity to the application. Another difficult thing is sharing dependencies, fortunately with module federation it can be done, but how can I use different versions of the same library and how does it work behind the scenes?
I'm the creator of module-federation/vite library, with React and this library, I'd like to show you how you can achieve these results by configuring everything correctly.
Federated Microfrontends at Scale
React Summit 2023React Summit 2023
31 min
Federated Microfrontends at Scale
Top Content
The talk will be a story of how Personio went from rendering through a Monolithical PHP architecture, to a microfrontend oriented Next JS app, powered by Module Federation and the NX monorepo toolchain.
Sharing is Caring: (How) Should Micro Frontends Share State?
React Summit 2022React Summit 2022
23 min
Sharing is Caring: (How) Should Micro Frontends Share State?
Micro frontends architecture is extremely powerful when it comes to splitting large frontend monoliths into smaller, individually deployable blocks, each is owned by an autonomous team and is focused on a business domain. But what about State? We are often told that micro frontends shouldn't share state, as this would make them coupled to each other. However, when it comes to complex UIs, it is not rare to encounter scenarios where state management between micro frontends is necessary. This talk is about finding the sweet spot — In which scenarios it is reasonable for micro frontends to share State? and how should micro frontends share State while remaining decoupled of each other? We discuss & compare different solutions in React.
“Microfrontends” for Mobile in React Native
React Advanced Conference 2023React Advanced Conference 2023
24 min
“Microfrontends” for Mobile in React Native
Scaling has always been an issue in software development. Architects have been grappling to solve this problem on many layers. In the early 2000s, a concept of “micro-services” started popping up - a system could be split up by business domain into a number of smaller loosely-coupled services. 
More recently, this concept has started being adopted by the frontend community. An app could be split into multiple sub-apps, each with their own teams, technologies, and codebases. Companies like Spotify, Amazon, and Microsoft have adopted this approach and it has helped them scale even faster.
In the world of mobile development, the question arises: “Can we create Microfrontends for mobile apps?”.

Workshops on related topic

Micro Frontends with Module Federation and React
JSNation Live 2021JSNation Live 2021
113 min
Micro Frontends with Module Federation and React
Workshop
Alex Lobera
Alex Lobera
Did you ever work in a monolithic Next.js app? I did and scaling a large React app so that many teams can work simultaneously is not easy. With micro frontends you can break up a frontend monolith into smaller pieces so that each team can build and deploy independently. In this workshop you'll learn how to build large React apps that scale using micro frontends.
Micro-Frontends with Module Federation and Angular
JSNation Live 2021JSNation Live 2021
113 min
Micro-Frontends with Module Federation and Angular
Workshop
Manfred Steyer
Manfred Steyer
Ever more companies are choosing Micro-Frontends. However, they are anything but easy to implement. Fortunately, Module Federation introduced with webpack 5 has initiated a crucial change of direction.
In this interactive workshop, you will learn from Manfred Steyer -- Angular GDE and Trusted Collaborator in the Angular team -- how to plan and implement Micro-Frontend architectures with Angular and the brand new webpack Module Federation. We talk about sharing libraries and advanced concepts like dealing with version mismatches, dynamic Module Federation, and integration into monorepos.
After the individual exercises, you will have a case study you can use as a template for your projects. This workshop helps you evaluate the individual options for your projects.
Prerequisites:You should have some experience with Angular.