Backend for Frontend Pattern in Microservices
Ғылым және технология
System Design for SDE-2 and above: arpitbhayani.me/masterclass
System Design for Beginners: arpitbhayani.me/sys-design
Redis Internals: arpitbhayani.me/redis
Build Your Own Redis / DNS / BitTorrent / SQLite - with CodeCrafters.
Sign up and get 40% off - app.codecrafters.io/join?via=...
In this video, I discussed the challenge of serving multiple types of clients as an application evolves, leading to a complex backend with various hacks. I introduced the architectural pattern called Back End for Front End (BFF) used in microservices to address this issue. BFF acts as a presentation layer between the core backend system and clients, filtering out unnecessary data for each client type. It enhances user experience, minimizes network bandwidth usage, and allows for client-specific tweaks without impacting the backend. This pattern is beneficial for both monolithic and microservices architectures.
Recommended videos and playlists
If you liked this video, you will find the following videos and playlists helpful
System Design: • PostgreSQL connection ...
Designing Microservices: • Advantages of adopting...
Database Engineering: • How nested loop, hash,...
Concurrency In-depth: • How to write efficient...
Research paper dissections: • The Google File System...
Outage Dissections: • Dissecting GitHub Outa...
Hash Table Internals: • Internal Structure of ...
Bittorrent Internals: • Introduction to BitTor...
Things you will find amusing
Knowledge Base: arpitbhayani.me/knowledge-base
Bookshelf: arpitbhayani.me/bookshelf
Papershelf: arpitbhayani.me/papershelf
Other socials
I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.
LinkedIn: / arpitbhayani
Twitter: / arpit_bhayani
Weekly Newsletter: arpit.substack.com
Thank you for watching and supporting! it means a ton.
I am on a mission to bring out the best engineering stories from around the world and make you all fall in
love with engineering. If you resonate with this then follow along, I always keep it no-fluff.
Пікірлер: 38
Loved the explanation! Clear and Crisp, To the point! Helped me a lot in understanding this pattern.
You have explained the concept very well Thanks for that.
Absolutely awesome video and to the point.. Keep it up Arpit!!
Code duplication might not really be a problem if the code in BFF is desgined well. The common parts being used for different types of clients can be extracted in to use cases.
Another gem by Aprit! Great explanation as always!
Amazing always ! thanks Arpit
Excellent explanation and very useful topics.
Hi, the explanation was really good and live. Keep up the good work!
loved the content! learnt something new ❤️
Excellent explanation, thanks
Beautifully explained!
Can't we use graphQL as the bff layer? That will avoid platform specific bff creation.
@AsliEngineering
2 жыл бұрын
Yes we can and it beautifully fits as a BFF and hence it is really a very common way to implement BFF pattern.
@manikantaannavarapu5415
2 жыл бұрын
I was about to ask the same question
@sahilsamantaray1101
2 жыл бұрын
Throughout the video I was thinking about how we can implement all of this using GraphQL.
Thank you for this video. I have question. Does the request url remain same for different bffs? For example, if idea is to fetch a product detail for prod prod_id, is the rest call still to the v1/api/products/{prod_id} ? If yes, then on what sort of intelligence does the particular bff tweaks or prunes the data? For example, how does mobile bff know to prune out the faq and review information? And in the subsequent call when we fetch for product review, does mobile bff make anothe call to generic BE or it makes use of cached info to extract the queried info? Is there any known tool or tech suggestions to implement bff or it can be a generic service like any other BE service? Also, considering bff can be a probable spof, in your experience how's the duplication setup like for bffs? Thank you 😊
Pretty good explanation thanks🎉
Awesome explanation!
One scenario i was thinking about - If our generic backend sends a generic response to all the BFFs and that response has some set of data that can't or rather shouldn't be cached and some of the BFFs are rejecting that at their level. But the computation for fetching those data would happen every time on backend, increasing unnecessary load on our resources. One solution that i can think for this from my end is that we might have some intelligent caching on these fields and would serve the cached data until requested otherwise by the client(BFFs) using some headers or params ! If you can suggest any other better solution/way for these types of scenarios it would help me. Thanks in advance 🙂
Thanks for sharing
Great video m8
Amazing
Good explanation can you make example video how you implement it practically.
Finally completed 😎😎 Getting the feeling of becoming a Senior Engineer very soon
@AsliEngineering
Жыл бұрын
You are making great use of your time 🙌 stay curious... Always.
Was worth to watch, great video. And yes there is something which I observed in the video (starting 14:02) which could be a kind of great add-on to your video if you add little bit funny situation. Starting the timing 14:02, you changed your tone to imitate like a "dari sahmi si ladki jisko hamesh question poochne main darr lagta h" and asked this question in that tone which I felt was a great moment in this video :D :D , And then I extended my imagination for this particular scene, I imagined you wearing a long hair wig with lipstick and earings and asking the question exactly like in that tone of Dari sahmi si ladki. :D :D
@AsliEngineering
2 жыл бұрын
Hahahhaha 😭😭😭 I wish I could enact more such situations. Maybe after some time when I build that camera confidence 😀😀
Where can I learn practically by implementing these?
@AsliEngineering
Жыл бұрын
Local machine. Not difficult at all.
Is GraphQL a BFF?
@AsliEngineering
19 күн бұрын
GraphQL is not BFF but it can be used to implement BFF.
❤️
Unusal timing today. Is there any change is the upload schedule Arpit?
@AsliEngineering
2 жыл бұрын
experimenting :)
@theSDE2
2 жыл бұрын
@@AsliEngineering oh ok
Can't we use graphql here?
@AsliEngineering
11 ай бұрын
Yes. We can. That's one on the ways to implement BFF
@ayushtripathi4514
11 ай бұрын
@@AsliEngineering got it. Thanks for replying back❤️