API Design for Distributed Systems · Key takeaways
1 min readRapid overview
Key takeaways
- Protocol choice follows the caller: REST at the edge for cacheability, gRPC internally, GraphQL for divergent clients.
- Offset pagination both slows down and silently skips or duplicates rows on changing data. Use keyset cursors with a unique tiebreaker.
- Any
POSTthat causes a side effect needs an idempotency key, and the key reservation must be atomic. - Adding optional fields is safe; changing a field's meaning is the most dangerous change because nothing fails.
- Errors are a contract: stable code, correct status, explicit retryability, correlation ID, no internal detail.