Sam Newman

samnewman.io · Personal blog · on HN since 2015

Sam Newman, a consultant and author of Building Microservices, writes about microservice architecture and patterns like Backend for Frontend.

What HN saysCommenters call his book great and link his Backend for Frontend pattern page, noting it goes into more depth than other articles.
36HN people shared it
17linked it in comments
21stories submitted
334story points
3 years agolast shared
2015people per year2026

Most-shared posts

  1. 1
    Pattern: Back ends for front ends
    20 people · 66 points · first shared 2015 · 11 comments on HN
  2. 2
    Don't Call It a Platform
    5 people · 7 points · first shared 2023 · discussion on HN
  3. 3
    Microservices for Greenfield?
    3 people · 7 points · first shared 2015 · 1 comments on HN
  4. 4
    Building microservices
    2 people · first shared 2018
  5. 5
    Building microservices 2nd edition
    2 people · first shared 2021
  6. 6
    Want to spell check? Read the fine print
    1 people · 248 points · first shared 2016 · 126 comments on HN
  7. 7
    The Case Against Certification
    1 people · 3 points · first shared 2015 · discussion on HN
  8. 8
    Principles of Microservices (2015) [video]
    1 people · 2 points · first shared 2019 · discussion on HN
  9. 9
    Capturing Microservice Patterns
    1 people · 1 points · first shared 2015 · discussion on HN
  10. 10
    Podcast
    1 people · first shared 2016

What HN people wrote when they linked it

stevenalowe · 2021-08-04
kevinr · 2016-07-21
I was just reading the other day this article about the Backend for Frontend pattern (BFF) which suggests the best way to avoid tight coupling is for services you don't want tightly coupled to be owned by different teams, and to allow reasonable duplication of functionality between them. Everybody knows how hard it is to get another team to implement functionality for you. This is where I got the BFF pattern from: http://samnewman.io/patterns/architectural/bff/
cdnsteve · 2015-12-15
I actually found the article from Sam Newman went into greater depth: http://samnewman.io/patterns/architectural/bff/ Interesting to see this creates new problems, such as blocking calls to dependant services downstream, and what services you declare as critical or not. Also duplicate code is unavoidable. So if you're attempting this pattern, keep those things in mind since you will have limited technology choices. Sound Cloud is using Scala here. https://developers.soundcloud.com/blog/building-products-at-soundcloud… Edit: Found their mention of technology
nerdix · 2024-03-08
This is also known as BFF (Backend For Frontend). Every client gets it's own API tailored for it's use case that will mostly just aggregate/orchestrate calls to the general purpose API. https://samnewman.io/patterns/architectural/bff/
tootie · 2023-08-20
This is BFF pattern described many years ago. Here's the standard way I build this kind of thing: Develop your APIs per functional or really per system. One for content, one for identity, one for ads or whatever. Then you build an orchestration tier that does pretty much what OP says. It stitches the various services together and returns a page model. The ideal is to reduce round-trips and cognitive load on FE dev. If you need the top 3 pieces of relevant content, plus an ad plus the user's first name, return all of that and nothing else. The last piece is just SSR. Use next or nuxt or whatever and you can output HTML on the server or stich it on the client with one codebase seamlessly. https://samnewman.io/patterns/architectural/bff/
vyrotek · 2022-11-13
Backends for Frontends. An alternative to making "one API to rule them all". Far less time spent trying to model an API in an abstract way that makes sense to many consumers. Instead, an API and the endpoints are designed for a specific client. (e.g. A Mobile App or SPA) For us, this also meant a more RPC based API where and reusability is managed after the network hop. https://samnewman.io/patterns/architectural/bff/
underwater · 2021-09-14
This approach is described by the cutely named BFF – backend for frontend – pattern. (https://samnewman.io/patterns/architectural/bff/)
jacobr · 2017-11-09
I would say Backend For Frontend solves the same problems for most people, and the tooling around REST is available everywhere. http://samnewman.io/patterns/architectural/bff/ We have data repositories living behind very simple REST controllers, an endpoint probably doesn't take that much longer to write than a GraphQL query.
dslama · 2017-08-24
I believe the author is referring to using node.js for the backend part in the backend for frontend pattern => http://samnewman.io/patterns/architectural/bff/
bergoo · 2016-12-26
Sam Newman's The Magpie Talkshow http://samnewman.io/podcast/
qwantim1 · 2021-01-27
The BFF pattern[1] may be more useful today to many, due to various types and sizes of devices and different sorts of integrations. MVC can be used in its place, but it would often introduce unnecessary complexity, e.g. additional controllers. MVC works for contextually equivalent interaction, which is still very useful, too. Mostly just do what makes sense. The challenge is, as it has been, how to be flexible, smart, and forward-looking, but developing quickly for what’s needed now. But whether you’re coding a quick prototype or designing a large project (which is risky because a feedback loop from all users may be longer), focusing too much on the how and specifics instead of the overall experience may get you into trouble later. For example, you could have what sounds ideal: microservices, individual teams each working on them focused on their own goals, powering a site with the latest, well-used JS framework, able to deploy quickly and developing quickly with a lot of fun-but-professional-looking communication, and end up with a slow, broken application. [1]- https://samnewman.io/patterns/architectural/bff/
Stoids · 2019-01-10
I appreciate you calling me out on my wording, because you are spot on. If anything GraphQL “bleeds” even more into my front-end code. I think the appropriate way to frame it is that GQL is a more targeted, holistic solution to the problem of fan-out data aggregation from the perspective of a UI client. Every UI codebase I had that depended on protos had significant chunks of code transforming the data more appropriate to our UI domain objects (that lived either in the front-end code base or one abstraction higher in a "BFF" [1]). Our UIs usually wanted to work with denormalized data structures, which was obviously in conflict with the proto models owned by small individual microservices. GQL simultaneously addresses those two specific problems: resolution of normalized data, and giving UI consumers the power to declaratively fetch their desired data shape. It also has first-class TypeScript support through Apollo and the open-source community built around that. I think it’s important to stress the tooling support, because you are correct… oneofs and union types are conceptually the same thing. A lot of it comes down to ergonomics in how you consume those types. In code generation GQL unions represent themselves as actual TypeScript union types, which means I can write type guards or switch on their discriminant to narrow to their correct member, whereas proto oneofs use a string value to access the correctly populated property. Small things in the day-to-day, but in how…
dustingetz · 2017-02-10
Frontend development involves I/O (server data fetching), which has implications - it is async - it can fail - it is slow TLDR you need a programmer to hand-orchestrate the I/O. REST (HATEOAS) link abstraction permits a general solution to data-driven user interfaces (this is why web browsers are a generic user interface for simple html-only applications), but they are slow due to the way the data fetching is handled - see former facebook manager Pete Hunt's quote here (2014) which predates GraphQL https://news.ycombinator.com/item?id=7601774. Essentially we are talking about the object/relational impedance mismatch, which has performance implications and generally requires hand optimizing by a programmer (tweak the backend queries to batch a lot of stuff and minimize database round trips; tweak the frontend to do as few network requests as possible..this causes the backend-for-frontend pattern (anti-pattern) where you get N backends each hand coded... you can't abstract over this and also have good performance. http://samnewman.io/patterns/architectural/bff/) So you need programmers to figure out the right perf compromises and write the same shitty glue code over and over. BUT if you have a graph oriented database with something like GraphQL to query it from the frontend, it's pretty easy to imagine abstracting over this stuff in a way that doesn't require hand-tuned performance e.g. Relay and Netflix Falcor, just needs one generic backend, and this paves the way for…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close