The API landscape has gotten complicated. Here's the decision framework you actually need.
REST
The old reliable. Still works great for:
- Public APIs consumed by many clients
- Simple CRUD operations
- Caching via HTTP semantics
- Teams already familiar with REST patterns
GraphQL
Great for:
- Complex data relationships
- Multiple client types (web, mobile, third-party)
- Reducing over-fetching
- Rapid iteration on frontend
Overkill for simple apps. Adds complexity everywhere.
tRPC
The new kid:
- Type-safe end-to-end without code generation
- Incredible DX if you're already in TypeScript
- No schema to maintain
- Works best with full-stack TypeScript apps
gRPC
For:
- High-performance internal services
- Microservice communication
- Strong typing across service boundaries
- When you need HTTP/2 streaming
The Decision Matrix
| Factor | REST | GraphQL | tRPC | gRPC |
|---|---|---|---|---|
| Simplicity | High | Medium | High | Low |
| Type safety | None | Partial | Full | Full |
| Performance | Medium | Medium | Medium | High |
| Caching | Native | Custom | None | None |
| Best for | Public APIs | Complex data | TypeScript apps | Microservices |
My Take
For most indie dev projects: tRPC if full-stack TypeScript, REST if you need broad compatibility, GraphQL if you have complex frontend data needs. When building APIs for extension backends, ExtensionBooster's API templates can speed up your implementation.
Top comments (0)