Backend for Frontend Pattern in Microservices
HTML-код
- Опубликовано: 10 сен 2024
- System Design for SDE-2 and above: arpitbhayani.m...
System Design for Beginners: arpitbhayani.m...
Redis Internals: arpitbhayani.m...
Build Your Own Redis / DNS / BitTorrent / SQLite - with CodeCrafters.
Sign up and get 40% off - app.codecrafte...
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.m...
Bookshelf: arpitbhayani.m...
Papershelf: arpitbhayani.m...
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...
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.
Loved the explanation! Clear and Crisp, To the point!
Helped me a lot in understanding this pattern.
Can't we use graphQL as the bff layer? That will avoid platform specific bff creation.
Yes we can and it beautifully fits as a BFF and hence it is really a very common way to implement BFF pattern.
I was about to ask the same question
Throughout the video I was thinking about how we can implement all of this using GraphQL.
You have explained the concept very well
Thanks for that.
Excellent explanation, thanks
Another gem by Aprit! Great explanation as always!
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 ❤️
Absolutely awesome video and to the point.. Keep it up Arpit!!
Thank you
Finally completed 😎😎
Getting the feeling of becoming a Senior Engineer very soon
You are making great use of your time 🙌 stay curious... Always.
Amazing always ! thanks 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.
Beautifully explained!
Awesome explanation!
Good explanation can you make example video how you implement it practically.
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 🙂
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 😊
Thanks for sharing
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
Hahahhaha 😭😭😭
I wish I could enact more such situations. Maybe after some time when I build that camera confidence 😀😀
Amazing
Is GraphQL a BFF?
GraphQL is not BFF but it can be used to implement BFF.
Where can I learn practically by implementing these?
Local machine. Not difficult at all.
Can't we use graphql here?
Yes. We can.
That's one on the ways to implement BFF
@@AsliEngineering got it.
Thanks for replying back❤️
❤️
Unusal timing today. Is there any change is the upload schedule Arpit?
experimenting :)
@@AsliEngineering oh ok
Pretty good explanation thanks🎉