TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

BFF, Backend for Frontends

10 点作者 aientech超过 1 年前

4 条评论

mosselman超过 1 年前
Those first two diagrams about the barista with customers explain it all.<p>From a customer perspective it is super luxurious to have your own barista. They know my tastes, I never have to wait... But then comes the bill, &quot;€2500 for a cup of coffee?!?&quot;. Expecting that you can keep selling €3 cups of coffee in this way is delusional.<p>Obviously choosing this architecture means you can create &#x27;smooth&#x27; conversations from the Front-end&#x27;s perspective, but it requires an insanely complex system of things underneath it. Expecting that you can efficiently build software like this is also delusional.<p>Of course there could be valid reasons to do this. As the diagrams indicate, it is about the experience you are providing for people developing applications. I mean a butler level of experience: If you can somehow charge an insane premium for this BFF setup, then have at it. I&#x27;d rather grab my own coffee.<p>Claiming that you are &quot;Simplifying Complex Systems with Backend for Frontends (BFF)&quot; is insane.
评论 #39042729 未加载
kcartlidge超过 1 年前
Without commenting on the relative merits of monoliths, microservices, graphql, BFFs etc., as an analogy it&#x27;s possibly worth thinking of the BFFs as interfaces tailored to specific use cases.<p>For example the backend may provide a reporting facility. For reasons of screen factor the available options and the resulting response data may vary depending upon if you&#x27;re on a mobile phone or a laptop.<p>The backend needs to allow for the most complex use case, so its endpoints will likely support all the options and return all the data regardless of the client. It may include filters to mitigate somewhat, but that is also extra complexity.<p>With the BFF scenario the small form factor device would have its own backend as would the large form factor. The large form factor one would likely transparently proxy the request&#x2F;response to&#x2F;from the original backend whereas the small form factor one would be free to offer a more limited (and hence less complex) request&#x2F;response definition based on the up-front awareness of what the device will be doing.<p>With this situation the shared functionality, data access, business logic, etc., all exist in the main backend so you still only have the one main codebase to maintain. The teams working on the various form factors only need to manage a thin abstraction layer suitable for their consumers who, in turn, benefit from a simpler API as it is focused to their use case.<p>The end result is still coupling, and <i>numerically</i> it&#x27;s actually <i>increased</i> coupling as instead of backend-to-client it is now backend-to-each-BFF plus each-BFF-to-client. However the extra layer in the middle (the &#x27;interface&#x27;) <i>removes</i> the kind of coupling that <i>requires</i> changes in the main backend to be done alongside changes in the clients. I&#x27;m aware that API versioning exists as another possibility, but again the idea here is to present an API directly suited to the consumer - and you can still use versioning within that context.<p>Each team responsible for a particular BFF is free to roll out their own version of changes, including either hiding&#x2F;ignoring them if they are not needed, or simplifying them or merging in relevant context if they are, <i>independently</i> and to their own timescale. This is the decoupling obtained; it simply works at a different abstraction level.<p>Again, I&#x27;m not offering a view on which approaches are superior (personally I don&#x27;t believe a single approach will ever be the best everywhere). I&#x27;m pointing out one main benefit which makes BFF worth considerating in case it suits your needs.
jelder超过 1 年前
Seems like you’d get a lot of the same benefits with GraphQL on a scalable backend like AWS Lambda.<p>Every page can use a (named) query for just the objects needed, and just the fields of those objects.
评论 #39050598 未加载
steve1977超过 1 年前
Complains about tight coupling, then goes on to create a dedicated backend to cater the needs for each frontend…
评论 #39042522 未加载
评论 #39042504 未加载