REST shines для resource CRUD и public APIs с HTTP caching; awkward для actions, chatty screens и fixed shapes.
Разбор
- REST shines для resource-shaped CRUD, public APIs — HTTP caching, proxies, broad tooling. Sensible default.
- Not everything resource. Actions «publish», «cancel» map awkwardly — sub-resources (
POST /orders/42/cancellation) или pragmatic controller endpoint.
- Chatty by design. One screen, many resources — round trips add latency. BFF composes server-side, или GraphQL.
- Fixed response shapes over-fetch on mobile. Sparse fieldsets (
?fields=id,name) help но re-implement GraphQL badly.
- HATEOAS — purest REST, almost nobody does it. Pragmatic REST + OpenAPI — industry reality.
Итог
REST default для CRUD/cacheable APIs; BFF/GraphQL когда chattiness или diverse field needs; не contort workflows в fake nouns.