It's all baked inside here, and there is a nice guide that describes how to use it. The second step is usually understanding what are the most common Microfront Ends architectures. I collected them for you, so you don't have to do that job. Usually, the majority of the time, either you do Microfront Ends on server-side rendering or client-side rendering, you start with an application shell or a UI composer. The responsibility of this piece of architecture is very simple. You load the website. It's the first thing loaded, either on the server or on the client. It handles the configuration, so finding information like which device you are rendering on. For instance, the country where the user is, and stuff like that. You have authentication, authorization, handle, centralized inside the application shell, composition, so how I can lazy load my Microfront Ends inside the UI, and routing at the first level of routing. I will show you in a second what I mean by that.
After that, you start to build your Microfront Ends. The most common implementation I've seen on-prem or on cloud is this one. Every team is building their own Microfront Ends, they ship static files into an object storage, possibly not containers, please, for many reasons, but in object storages are absolutely fine, or blob storage, where you put your static files, you put the CDN in front of it, and the application shell is just pulling these static files from there. CDN plays a fantastic role here, because it's not only for static analysis, for static assets, but also for security, routing, etc. Client-side, very simple, there is no rocket science behind that. Server-side rendering is way more complicated.
Once again, in this case, we have the application shell that is living instead on the server. When the browser asks your website, the CDN is passing through the specific cluster of containers or serverless functions, and in this case, you basically route through the CDN, so you have multiple origins that are hitting different endpoints. It could be slash home, slash products, slash my account. Surprise, surprise, these can resemble the structure of your teams or domains inside your application. And therefore, I have a team that is dedicated for rendering the home, the products, etc. The application shell here is baked alongside the Microfront End itself. The beauty of this is that I can cache every single endpoint in different ways. I can decide that the home should have a TTL of time to live in the CDN of 10 seconds. At least it absorbs a bit of traffic. But my account or checkout might be longer, because it's very stable, it doesn't change very often. This is a technique I use a lot. For instance, websites that probably you have heard about, formula1.com is built in this way. Server-side rendering can also be on the next step, where I have a UI composer that is living inside a container, like slash home, and I have a bunch of static files that are loaded time to time.
Comments