MICRO FRONTENDS – THE NEW FRONTEND ARCHITECTURE
There were times when the entire application was built as a single monolith. A single application was responsible for backend as well as server side rendering of UI.
Microservices exploded as a popular architectural pattern for developing large, complex, and growing applications. This pattern splits the backend into number of small services that are more focused, manageable, scalable and technology agnostic.
We saw great advantages of using microservices at the backend, but many large applications still implement UI layer as a monolith. Now a days, UI aka front ends aka single page applications are feature-rich implementations and are quite complex and has developed a need to be split up into smaller focused implementations.
Micro frontends is a new buzzword in the world of front end. The architectural style for front end applications that enables them to be developed as a composition of independently deliverable loosely coupled small applications. Micro frontends are intended to bring the same advantages to front end applications that microservices brought to the banckend.
Facts about Micro-Frontends
Benefits of Micro-Frontends
Different ways of building Micro Frontends
There can be different ways of implementing micro frontends as listed below.
HTTP server routing to redirect to multiple micro-apps.
Integrate different micro-apps at build time.
Integrate different micro-apps at run time.
Use iFrams for loading different micro-apps.
Use different frameworks available for building micro-frontends.
Available frameworks that can be used to build micro frontends
There already are a couple of frameworks available to build micro frontends. Here is a list of some such frameworks.
- Module Federation
- Module Federation
- System JS
- Open components
Frontend applications are becoming complex day by day. Large and complex frontend applications need an architecture which will give the same advantages of microservices. Micro-frontends are taking root into frontend ecosystem. Micro frontends enable development of manageable small micro applications.
Even though Micro-frontends bring in lot of advantages, it is not a silver bullet. As every other architecture, there is a trade-off between monolithic architecture vs Micro-frontends architecture. Applications can take advantage of this architectural style if chosen wisely considering specific requirements and aspects of development and maintenance.