How to do it...

In order to design and build a BFF layer, we should first design the API. In fact, we've already done this. In the previous recipe, we demonstrated using CompletableFuture to asynchronously make a request to our systems, social service and then for each user returned, make asynchronous requests to the user-details-service to fetch certain user profile information. This is a great use case for a BFF layer for our mobile apps. Imagine that our mobile app has a screen that shows a list of users that the user follows, with basic information such as their avatar, username, and display name. Since the social graph information (the list of users the user is following) and the user profile information (avatar, username, and display ...

Get Microservices Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.