Live data from Hacker News

Microfrontends should be a last resort

breck-mckye.com

21–30 of 143 posts

Re: Microfrontends should be a last resort

#21
Micro frontends are mostly trying to solve organizational issues, from what I’ve seen. You have some teams or individuals who really want to use a different tech for their project, or get away from legacy code without rewriting it, etc.

I interviewed at a place a couple months ago that was looking for an front end architect, and all the assumptions and questioning were that their use of microfrontends (both angular and react) was a good thing and how would I make teams follow this approach.

They passed on me when I made it clear that I didn’t think it was a very good approach for their smallish team, and in general that the challenges they were experiencing were mostly because of this architecture, not solved by it.

Re: Microfrontends should be a last resort

#22

Earlier quoted context omitted.

You're right, I didn't give any numbers. IMO for every dozen engineers you are allowed one monolith (but now you call it a service).

> but now you call it a service What is a problem in itself. On every sane place, most of the "services" aren't providing any on-demand service, instead they are just thematic monoliths doing all of a part of a task. I'm settling on the opinion that a service-based architecture is always wrong. But people keep calling the good architectures by that name.

Well, you’re almost at the moment of enlightenment.

Yes, all the good architectures are service based. And all service based architectures are wrong. Because all architectures are wrong.

In the sense that there’s always another way you could have architected it that would be better for where you think you want to go next, than the way it is architected.

Learn to accept that an evolving software system is always going to have a suboptimal architecture.

Re: Microfrontends should be a last resort

#23
I think it's less about the technology than the organizational structure. If you have more than one monolith (aka any company with an acquisition) you either have to have it in code in two places (gross) or as a library. If you have it as a library, then you have N version bumps to do an N pipelines to deploy. Not hard technically, but tons of overhead.

This means that you lose independence and doing A/B testing becomes very difficult when you can't really control what the user is seeing because the version is pinned.

A micro front end allows you to deploy independently, test independently, and truly own your code. Network hops are reasonably cheap for most consumer applications and collaboration on a shared component is very expensive.

I'm speaking from the perspective of a checkout flow, which my company is actively ripping out from the monolith in order to ensure people outside the monolith can use it AND to ensure we're able to do the price testing/conversion rate testing at a level that doesn't need a separate suite of tools for each business unit. This also has the benefit of reducing integration points with the billing system leading to better standardization and consolidated data in one billing system.

Re: Microfrontends should be a last resort

#24
post #20

> Microfrontends are very popular on the conference circuit, so I am probably about to make future job interviews awkward by criticisng them. This has been my experience with conferences lately: Way too much emphasis on the next big trend, to the point of being counterproductive for actually getting work done Certain teams and companies live and die by conference trends. If you can't also show interest in those trend…

> The team lead explained that knowing about them was his primary signal for someone's overall competence. God help us.

> God help us.

Good luck, I think God is too busy refactoring his Perl code.

Re: Microfrontends should be a last resort

#25
I have designed and built something that could be described as a microfrontend system (though it's much more restrictive than "do what you like within this part of the page") and though it's been pretty successful I agree totally with the article. It's a lot of complexity if it isn't definitely worth it. Our "microfrontends" are really dynamically-loaded JavaScript modules of a particular type. They conform to one of a small handful of well-defined extension points, including defining UI (in React components, as it happens, but clearly this isn't React-specific). In this way engineers stay more or less on the golden path, and we can do some runtime checks to try and give better error messages. I think if we'd built something more general it would have been a mistake.

Re: Microfrontends should be a last resort

#26
post #24
post #20

Earlier quoted context omitted.

> The team lead explained that knowing about them was his primary signal for someone's overall competence. God help us.

> God help us. Good luck, I think God is too busy refactoring his Perl code.

I think we both know it’s all lisp.

Re: Microfrontends should be a last resort

#27

> Microfrontends are very popular on the conference circuit, so I am probably about to make future job interviews awkward by criticisng them. This has been my experience with conferences lately: Way too much emphasis on the next big trend, to the point of being counterproductive for actually getting work done Certain teams and companies live and die by conference trends. If you can't also show interest in those trend…

I feel like buzzword bingo in conferences is unavoidable.

The three easiest ways to get someone's attention in a title are: being a well known speaker, talking about a giant project, or talking about a trend.

As much as there is value in "tricks to avoid false negatives during CI" it just isn't as catchy.

Re: Microfrontends should be a last resort

#28
post #18

I see orgs trying to use micro-things to solve problems caused by a lack of high-level direction, architecture, design and organization. The problem is, micro-things require better high-level direction, to avoid becoming a tangle of poorly integrated, poorly performing, expensive things. If end users can tell you're using micro-frontends, you've done it wrong. If you need 20 people in 10 meetings to change your app's…

FWIW, these architectures tend to follow the org or business entities (there must be a catch name for that phenomenon).

Solving a balkanized, poorly integrated services often goes through restructuring the business teams and realign them under a single umbrella. I see it as the poster child for "solving technical problems through social solutions"

Re: Microfrontends should be a last resort

#29
I’ve worked on two 100+ weekly committer monoliths and two similar sized MFE architectures. I think the article hits good points though I’d add some acutely painful ones it misses[1]. I’m someone who is by gut now squarely in the pro-monolith camp, but I think that in the comment thread of a similarity anti-MFE article it’s worth steel manning the pro-MFE arguments rather than characterize it simplistically as cargo-culting or resume-boosting.

First, MFEs solve organizational issues by cheaply offering release independence. An example is when teams that do not overlap in working hours. Triaging and resolving binary release blockers is hard to do correctly and onerous on oncall WLB. Another example is when new products want to move quickly without triggering global binary rollbacks or forcing too fast a release cadence for mature products with lower tolerance for outages or older test pyramids.

Second, MFEs are a pragmatic choice because they can proceed independently from the mono/microrepo decision and any modularization investment, both of which are more costly by several multiples in the cases I've seen. Most infra teams are not ivory towers and MFEs are high bang-for-buck.

Finally, MFEs are a tool to solve fundamental scaling issues with continuous development. At a certain level of commits, race conditions cause bugs or build breakages or test failures, and flaky tests cause inability to (cheaply) certify last known good commit at cut time. You can greatly push out both of these scaling limits with good feature flag/health-mediated releases and mature CI, but having an additional tool in the kit allows you to pick which to invest in based on ROI.

Advocating for modularity is nice but I've never met an MFE advocate who didn't also want a more tree-shakeable modular codebase. We should not jump to the conclusion the MFE as bad or a "last resort" because there exists another solution that better solves an partially overlapping set of problems, especially if the other solution doesn't solve many problems that MFEs do or requires significant more work to solve them.

[1] Runtime JS isolation (e.g. of globals set by third party libraries) is hard and existing methods are leaky abstractions like module federation or require significant infra work like iframing with DOM shims. CSS encapsulation is very hard on complex systems, and workarounds like shadow DOM have a11y and library/tooling interop issues. Runtime state sharing (so not every MFE makes its own fetch/subscriptions for common data) is hard and prone to binary skew bugs. Runtime dynamic linking of shared common code is hard to reason around and static linking of common code can result in the same transition of a lazy loaded module to go from taking 10kB to 1MB+ over the wire.

Re: Microfrontends should be a last resort

#30
I agree with a lot of this - MFE are much harder to pull off than the backend services, and I have yet to see a successful solution based on how they are often presented at the bleeding edge. We have had moderate success with pretty rudimentary implementations (think: iframes) but it is definitely not pain free. I'd highly recommend you look for this sort of architecture to STOP contributing to the monolith before you look to fix it, which I think aligns with the author's recommendation to get your sh!t in order before you distribute your monolith, which will be a Vietnam for your team.
Post reply on HN