Intermediate
Open
Pro
REST, gRPC or GraphQL for a New Platform
An e-commerce company is splitting a monolith into services: Catalog, Inventory, Pricing, Cart, Checkout. Consumers are (a) a public partner API used by hundreds of third-party sellers, (b) an iOS/Android app whose product page composes data from Catalog + Inventory + Pricing + Reviews, and (c) the services calling each other at ~50k requests/s aggregate.
- Recommend a protocol for each of (a), (b), (c) and justify with concrete properties (payload, contract, tooling, caching, browser support).
- If you pick GraphQL for (b), describe the N+1 problem that a naive
products { reviews { author { name } } }resolver causes and how DataLoader fixes it. Include rough query counts for 20 products with 10 reviews each. - Name two other risks specific to GraphQL and one mitigation each.
Share this question