API styles
| Style | Use when |
|---|---|
| REST (JSON over HTTP) | Default public API; resources + verbs; cacheable GETs |
| gRPC | Service-to-service; fast binary, typed contracts, streaming |
| GraphQL | Many clients needing different shapes of data; avoids over-fetching |
| WebSocket / SSE | Server pushes to client in real time (chat, live scores) |
Good API habits: pagination (cursor > offset at scale), idempotency keys on POSTs that create money/orders, versioning (/v1), and consistent error shapes.