Question 1
A Developer using API Mesh is assigned to optimize the integration of several third-party APIs with Adobe Commerce. Part of this task is to address performance issues such as the n+1 problem.
In this scenario, which option should the Developer implement?
- AOption A:
Use API Mesh to replace the existing APIs with direct GraphQL queries.
- BOption B:
Use API Mesh batching to combine multiple API requests into a single query.
- COption C:
Use API Mesh as a middleware for aggregating data from APIs back into Adobe Commerce.
Show answer and explanation
Correct answer: B
The n+1 problem occurs when multiple queries are made individually instead of being grouped, leading to inefficient performance.
API Mesh batching solves this by combining multiple GraphQL requests into a single query, reducing round trips and improving response times.
A is incorrect: API Mesh does not “replace” APIs but orchestrates them.
C is partially correct but too general; aggregation alone does not solve the n+1 problem.
B is correct: batching specifically addresses n+1 query performance issues.