most read
Software Engineering
Why We Killed Our End-to-End Test Suite Sep 24
Culture & Values
The Spark Of Our Foundation: a letter from our founders Dec 9
Software Engineering
The value of canonicity Oct 30
Careers
We bring together great minds from diverse backgrounds who enable discussion and debate and enhance problem-solving.
Learn more about our careers



Are you facing challenges in scaling your front-end to meet a growing number of users? With the increasing complexity of modern web applications, strategies like micro front-ends, monorepositories, global state management, and cache optimization are essential.
In this article, we explore best practices for scaling front-end applications, discussing how to implement micro front-ends, manage versions in monorepositories, apply effective caching strategies, and efficiently maintain global states.
Discover how Nubank is overcoming scalability challenges in the front-end and how you can apply these approaches to build agile, responsive, and easy-to-maintain user interfaces.
The Challenge of Scale
Companies like Nubank face unique challenges. With over 100 million customers in Brazil, Mexico and Colombia, handling large-scale distributed systems is not just a necessity but an obligation. Managing transactions like PIX, ensuring service stability, and providing a consistent user experience require innovative solutions.
Moreover, working with advanced technologies like Clojure and Datomic—whose development is influenced by engineers within Nubank itself—adds additional layers of complexity and opportunity. These technologies are not just tools; they are integral parts of our scalability strategy and continuous innovation.
Check our job opportunities
Micro Front-Ends: Dividing to Conquer
The micro front-end architecture has emerged as a solution to many challenges faced by large development teams. But what exactly are micro front-ends?
What Micro Front-Ends Are (and What They Aren’t)
Micro front-ends are an extension of the microservices concept to the front-end. They allow different teams to develop, deploy, and maintain distinct parts of the user interface independently.
This means that each team can work at its own pace, choose its own technologies (to a certain extent), and deploy updates without impacting the system as a whole.
It’s important to highlight that micro front-ends are not:
Benefits of Micro Front-Ends
Costs and Considerations
Implementation Strategies
There are several approaches to implementing micro front-ends:
Client-Side Composition
This is the most common approach, where the integration of micro front-ends occurs in the user’s browser. Technologies like Web Components, Module Federation (Webpack 5), and frameworks like Single SPA facilitate this composition.
Server-Side or CDN Composition
The assembly of micro front-ends occurs before reaching the client, either on the server or CDN. Tools and techniques like Edge Side Includes (ESI) can be utilized.
Communication Between Micro Front-Ends
Efficient communication is essential. It’s recommended to use:
Version Control in Monorepositories
Managing versions in a monorepository can be challenging, especially when multiple teams are working on different parts of the system. Here are some practices to handle this:
Individual Package Versioning
Tools like Lerna or Nx allow you to manage individual package versions within a monorepository. This enables each team to control the versions of their own components or modules, maintaining independence and facilitating coordination.
Avoiding Git Submodules
While Git submodules might seem like a solution, they often introduce additional complexity. Instead, using NPM or Yarn workspaces can simplify the management of internal dependencies.
Benefits of the Monorepository
Caching Strategies for Bundle Loading
Efficiency in loading resources is crucial for application performance. Well-implemented caching strategies can significantly improve the user experience.
Caching Shared Resources
By using technologies like Module Federation, it’s possible to share common dependencies among different micro front-ends, avoiding redundant downloads. To achieve this:
CDN-Level Caching
Utilizing a Content Delivery Network (CDN) allows static resources to be delivered more quickly to users by leveraging distributed caching.
Browser Caching
Managing Global States in Host Applications
Maintaining a consistent global state in an application composed of multiple micro front-ends is a challenge.
Recommended Strategies
Best Practices
Standardization and Platform Teams
While micro front-ends address technical scalability, code standardization and the existence of platform teams are crucial for the human scalability of development teams.
The Role of Platform Teams
Importance of Standardization
Avoiding Unnecessary Complexity
Organizational Laws Applied to Code
Conway’s Law states that a system’s structure reflects the organization structure that develops it. Therefore, aligning technical architecture with team organization is not just beneficial but essential.
How to Start
Conclusion
Scaling front-ends effectively requires a combination of technical and organizational solutions. Micro front-end architectures offer a path to handle technical complexity, while standardization and platform teams address the human challenges of large-scale collaboration.
At Nubank, we understand that continuous innovation and adaptability are essential to provide the best experience to our customers. Whether adopting advanced technologies or restructuring our teams, we are committed to evolving and facing the scalability challenges of the modern world.
Want to be part of this challenge? We’re always looking for talents passionate about technology and innovation to build the purple future together!
For more insights like these, watch the recording of the Engineering meetup.
Check our job opportunities