Bird
0
0

Which pattern best fits this requirement?

hard📝 Application Q15 of 15
Rest API - Advanced Patterns
You need to design an API Gateway pattern that aggregates data from user-service and order-service to provide a single response for a client request to /user-orders/{userId}. Which pattern best fits this requirement?
ARate limiting pattern to restrict client requests
BSimple proxy pattern forwarding requests directly to one service
CBackend for Frontend (BFF) pattern to combine multiple service responses
DCircuit breaker pattern to handle service failures
Step-by-Step Solution
Solution:
  1. Step 1: Identify the need for data aggregation

    The client wants combined data from two services in one response, which requires aggregation logic.
  2. Step 2: Match pattern to requirement

    The Backend for Frontend (BFF) pattern is designed to aggregate and tailor responses for specific client needs by calling multiple backend services.
  3. Final Answer:

    Backend for Frontend (BFF) pattern to combine multiple service responses -> Option C
  4. Quick Check:

    Data aggregation needs BFF pattern [OK]
Quick Trick: Aggregate multiple services with Backend for Frontend pattern [OK]
Common Mistakes:
MISTAKES
  • Choosing simple proxy which doesn't aggregate
  • Confusing rate limiting with aggregation
  • Using circuit breaker which handles failures, not aggregation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes