system-designlisted
Install: claude install-skill soliblue/cloude
# System Design Reference
## Core Concepts
### Networking
- **HTTP**: Request-response, stateless. Default for most APIs.
- **WebSockets**: Bidirectional, persistent. Chat, gaming, collaborative editing.
- **SSE**: Server to client only, over HTTP. Live feeds, notifications. Simpler than WebSockets when you do not need client to server.
- **gRPC**: Binary (protobuf), bidirectional streaming. Service to service.
- **L4 load balancer**: TCP-level, fast, supports persistent connections.
- **L7 load balancer**: HTTP-level, routes by path/header, content-aware.
### API Design
- **REST**: Resource-based, stateless, HTTP verbs. Default for public APIs.
- **GraphQL**: Client specifies exact data shape. Good when clients have diverse data needs.
- **gRPC**: Protobuf, streaming. Best for internal service to service.
- Pagination: cursor-based > offset-based at scale (offset degrades with depth).
### Data Modeling
- **Relational (Postgres)**: Structured data, strong consistency, complex queries, ACID. Default choice.
- **NoSQL**: Flexible schema, horizontal scaling, high write throughput. Choose for specific access patterns, not by default.
- Start normalized, denormalize hot paths only when needed.
- NoSQL does not mean "no relationships". It means different access pattern optimization.
### Caching
- Cache hit ~1ms (Redis) vs 20-50ms (DB). 20-50x speedup.
- **When**: Read-heavy, data does not change often, can tolerate staleness.
- **Invalidation**: Short TTLs, write-through, or a