Micro-Frontends Performance and Centralised Data Caching

Rate this content
Bookmark

Common myths about Micro-Frontends hold that they are bad for performance or that developers implementing this architectural style don’t care about the performance implications because they are focusing on fixing the developer experience and organizational issues rather than focusing on the user experience, however, the reality is altogether different. Micro-Frontends are not inheritably bad for performance and, as is often the case in software development, making best use of the technology depends on correct implementation. This talk will demonstrate how Micro-Frontends can make your applications faster and more resilient while keeping the benefits of independent deployments.

FAQ

OneApp is a micro front-end framework utilized by American Express. It acts as a meta framework for about 2,000 developers within the company, facilitating the development and maintenance of applications that serve a global customer base.

Microphone tents refer to micro front-ends, a concept in web development that applies principles of microservices to front-end architecture. They allow for independent deployments, scalability, and the coexistence of multiple frameworks on a single page, which can be advantageous during transitions, such as migrating from an old technology to a new one.

The biggest misconception about micro front-ends is that they are inherently bad for performance, primarily due to the belief that they necessitate mixing multiple JavaScript frameworks on a single page, leading to increased complexity and potential performance issues.

Micro front-ends enable various teams within an organization to deploy their applications independently. Each team manages their own repositories and deployments, allowing for updates and changes without needing to coordinate closely with other teams or restart servers.

The Strangler pattern is a method used in software development for gradually transitioning from an old system to a new one. In the context of micro front-ends, it allows developers to incrementally replace parts of the front-end using new technologies without a complete overhaul, thereby improving the application piece by piece.

Using multiple micro front-ends on the same page can lead to performance issues such as increased network requests and larger bundle sizes if not managed properly. This approach can also lead to duplicated dependencies, which can further degrade performance, especially on devices with slower internet connections.

American Express uses a distributed shared cache approach to manage data fetching in micro front-ends. This strategy prevents multiple micro front-ends from making redundant API requests by sharing cached data across different instances, thus reducing the number of network calls and improving performance.

Ruben Casas
Ruben Casas
27 min
22 Oct, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Micro front-end architecture, like microphone tents, can help scale applications by applying microservices principles to the front-end. Microphone tents can be beneficial for performance, depending on the implementation. They can reduce bundle sizes, avoid duplicated dependencies, and ensure independent deployments. The shared API and module federation are powerful features that allow for dependency management. Micro front-ends can improve developer experience and user experience while addressing organizational and scaling issues.

1. Introduction to Performance and Microphone Tents

Short description:

Hello, everybody! Today's topic is performance. I am a senior engineer at American Express, and I work on the micro front-end framework called OneApp. It's open-source and used by 2,000 developers. With millions of users, performance is crucial. Micro front-end architecture, like microphone tents, can help scale applications by applying microservices principles to the front-end. Independent deployments are a key benefit. However, there are many misconceptions and myths around microphone tents.

Hello, everybody, and welcome to my presentation. Today is a very interesting topic, and it's about performance. My name is Ruben. I am a senior engineer at American Express, and that is my Twitter handle if you want to give me a follow.

What do I do at American Express? Well, I am part of a team that maintains a micro front-end framework called OneApp. It's like a meta framework that we use at American Express. And this framework is open-source, and it's used by about 2,000 developers, so there is a 2,000-developer team at Amex that use this framework, and it's also our applications are used by multiple customers worldwide.

Now the question is, when you have so many users, what is the first thing that comes to your mind? Well, performance. We need to make sure that all those millions of users have great performance. Now, before we start with the performance section, I'm just going to get this out of the way because we get this quite a lot. I've seen this tweet so many times. Are microphone tents a thing yet? Or the other one is, why can't we just use components? Let me just answer that question very briefly before we get into the performance section. Well, microphone tents, yes, they are a thing. And, also, they've been around for a while. It's not like they are a new thing or something that is brand-new technology. It's been around for a little while. Basically, what they can do is they can help you scale your applications by applying the same principles that you have for microservices to the front-end.

Now, quick disclaimer here. I am not going to try and convince you that microphone tents are great and that you should come and start using them tomorrow. This is not why I'm here today. But if you use microphone tents, you will get really nice benefits. Like, the main one, in my opinion, is independent deployments. So, if you have a large team or multiple teams, they can deploy independently. They can have their own repositories and they can just have their own thing, everything sets up and they can deploy independently. Different parts of the website, of the web application. The thing with one app is we don't have to restart the server. You can deploy a new version and it automatically uploads itself without restarting the server. If I didn't convince you with this, I brought some pizza, if anyone wants some pizza. I'm not trying to convince you here! Now, there is a problem with microphone tense, a big, big problem. This problem is there are many misconceptions, and there are many myths around microphone tense.

2. Microphone Tents and Performance

Short description:

The biggest myth about microphone tents is that they are bad for performance. This misconception stems from the belief that microphone tents involve mixing multiple frameworks on the same page. However, this is a false myth. While it is possible to use multiple frameworks on the same page, it is not necessarily a good idea. The Strangler pattern is a recommended approach for migrating from an old application to a new one, allowing for incremental transformation of the UI. Microphone tents can be beneficial for performance, depending on the implementation.

The biggest by far is they are bad for performance. Yes, that is the biggest myth about microphone tense, and let me just ... there's one reason for this, and I've found why people think that microphone tense are bad for performance. And the reason is, well, people think that microphone tense are all about mixing libraries on the same page, so we have React, and Angular, and Vue, and Svelte, and Infinity Dash on the same page. Is that what microphone tense are about? Well, let me just tell you this is a false myth, and that's why people think that microphone tense are bad for performance.

The first thing they find about microphone tense is it's about React, Angular, and everything on the page. Let me just ask, is that a good idea? Is that a good idea? My friend Ken thinks it's a good idea. It's not a good idea. You can, yeah, so you can use React, and Angular, and all these frameworks on the same page, but just because you can, doesn't mean you should. So, although, this is there's only one case, one specific use case where it might be a good idea. It's not great, but it is a valid use case of having multiple frameworks on the same page. And this is the Strangler pattern.

The Strangler pattern is the best thing you can do if you are migrating from an old application, like a legacy application to a new one. How many of you here had to rewrite your old AngularJS application into React? Me! It's very common. So, these are very common use case. For the last five, six, seven years, AngularJS is not good, let's replace it with React. What do we do? We just completely stop development, say to the product managers, I'm sorry, we can't do any more features because AngularJS is bad and we can't maintain it. We need to replace it with React. The first thing they will tell you is, what? No! You can't do that! I mean, probably some people do it. What the Strangler pattern will help you do is help you incrementally transform your application. You don't have to do like a big bang transformation, release, rewrite of the whole application. What you can do is start applying the microfront-end pattern and the Strangler pattern to uplift different pieces of the UI.

The best thing is, well, can we just start route by route? Yes, you can, but when you have multiple pieces on the same page that you need to change, and sometimes one page is a lot of work, it's like the entire application is one page. With microphone tents, what you can do is you can start from a very small part on that page that is going to use React, the rest is going to use Angular, and then at some point, this is the key, you remove Angular. You don't keep both on the same page because performance! Yes, we shouldn't do that. So this is the only case where it might be useful to have multiple frameworks on the same page. So microphone tents can be good for performance. Disclaimer there, like a star, fine print. It depends on your implementation. Everything in architecture, it depends on how you implement it.

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

A Guide to React Rendering Behavior
React Advanced Conference 2022React Advanced Conference 2022
25 min
A Guide to React Rendering Behavior
Top Content
React is a library for "rendering" UI from components, but many users find themselves confused about how React rendering actually works. What do terms like "rendering", "reconciliation", "Fibers", and "committing" actually mean? When do renders happen? How does Context affect rendering, and how do libraries like Redux cause updates? In this talk, we'll clear up the confusion and provide a solid foundation for understanding when, why, and how React renders. We'll look at: - What "rendering" actually is - How React queues renders and the standard rendering behavior - How keys and component types are used in rendering - Techniques for optimizing render performance - How context usage affects rendering behavior| - How external libraries tie into React rendering
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.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Too much JavaScript is getting you down? New frameworks promising no JavaScript look interesting, but you have an existing React application to maintain. What if Qwik React is your answer for faster applications startup and better user experience? Qwik React allows you to easily turn your React application into a collection of islands, which can be SSRed and delayed hydrated, and in some instances, hydration skipped altogether. And all of this in an incremental way without a rewrite.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
React 18! Concurrent features! You might’ve already tried the new APIs like useTransition, or you might’ve just heard of them. But do you know how React 18 achieves the performance wins it brings with itself? In this talk, let’s peek under the hood of React 18’s performance features: - How React 18 lowers the time your page stays frozen (aka TBT) - What exactly happens in the main thread when you run useTransition() - What’s the catch with the improvements (there’s no free cake!), and why Vue.js and Preact straight refused to ship anything similar
The Future of Performance Tooling
JSNation 2022JSNation 2022
21 min
The Future of Performance Tooling
Top Content
Our understanding of performance & user-experience has heavily evolved over the years. Web Developer Tooling needs to similarly evolve to make sure it is user-centric, actionable and contextual where modern experiences are concerned. In this talk, Addy will walk you through Chrome and others have been thinking about this problem and what updates they've been making to performance tools to lower the friction for building great experiences on the web.
Optimizing HTML5 Games: 10 Years of Learnings
JS GameDev Summit 2022JS GameDev Summit 2022
33 min
Optimizing HTML5 Games: 10 Years of Learnings
Top Content
The open source PlayCanvas game engine is built specifically for the browser, incorporating 10 years of learnings about optimization. In this talk, you will discover the secret sauce that enables PlayCanvas to generate games with lightning fast load times and rock solid frame rates.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
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.
React Performance Debugging
React Advanced Conference 2023React Advanced Conference 2023
148 min
React Performance Debugging
Workshop
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Master JavaScript Patterns
JSNation 2024JSNation 2024
145 min
Master JavaScript Patterns
Workshop
Adrian Hajdin
Adrian Hajdin
During this workshop, participants will review the essential JavaScript patterns that every developer should know. Through hands-on exercises, real-world examples, and interactive discussions, attendees will deepen their understanding of best practices for organizing code, solving common challenges, and designing scalable architectures. By the end of the workshop, participants will gain newfound confidence in their ability to write high-quality JavaScript code that stands the test of time.
Points Covered:
1. Introduction to JavaScript Patterns2. Foundational Patterns3. Object Creation Patterns4. Behavioral Patterns5. Architectural Patterns6. Hands-On Exercises and Case Studies
How It Will Help Developers:
- Gain a deep understanding of JavaScript patterns and their applications in real-world scenarios- Learn best practices for organizing code, solving common challenges, and designing scalable architectures- Enhance problem-solving skills and code readability- Improve collaboration and communication within development teams- Accelerate career growth and opportunities for advancement in the software industry