BFF (Also BIF!)

In the world of (micro?)services, a Backend For Frontend (BFF) is a layer that gets used to isolate the backend semantics (e.g., whatever goofy stuff your resident #CowboyDeveloper came up with) from the Frontend
For example, say you’re running an (exclusive! boutique-y!) clothing store, and the resident genius set up a whole bunch of individual services that return each type of clothing. get_shirts() for shirts, get_slacks() for slacks, and so forth.
You could just invoke these individually from the Frontend, it might make sense in some situations. However, if you don’t (and won’t ever!) care about all these wee services, you could slap in a layer that would translate one single get_clothes() call into the individual get_shirts(), get_slacks(), etc. calls.
The major advantage here is that it allows you to abstract away the details of all the various services that you have behind the scenes, and present it as only the higher level abstractions that your front-end cares about. (And yes, this is a seriously contrived example — whatever)
Mind you, this isolation layer can serve a slightly different purpose too — it can also provide these abstractions in different forms, based upon the specifics of requesting frontend.
For example, the web frontend and the IoT frontend might have completely different bandwidth constraints, serialization formats, etc. The BFF here acts as an isolation layerto hide these frontend constraints from the various backend services, hopefully preventing at least some of these abstractions from leaking through 🙌
BIFA variation of the above is when the abstraction layer is moved into the Frontend. You might end up doing this when yourfrontend abstractions don’t necessarily map to the Backend(e.g., you need to do some weird Kotlin stuff that doesn’t really map to anything that the backend Ruby folks are doing.
That said, a much more common reason for this is because you have limited insight and/or influence into the backend team, and getting them to add the BFF (or, heck, a get_clothes() method) is a sucker’s bet…
So there you go. BFF and BIF — now you know!

Comments

Popular posts from this blog

Cannonball Tree!

Erlang, Binaries, and Garbage Collection (Sigh)