Design scalable, resilient systems.
2 topics
Vertical scaling (bigger machines) vs horizontal scaling (more machines). Load balancers: distribute traffic (round-robin, least connections, consistent hashing). Stateless services: any instance can handle any request. Database scaling: read replicas, write-ahead logs, sharding strategies. Caching: browser, CDN, application (Redis), database query cache. Queue-based processing for async tasks.
2 resources
RDBMS (PostgreSQL): ACID, joins, strong consistency. NoSQL: document (MongoDB), key-value (Redis, DynamoDB), column-family (Cassandra), graph (Neo4j). CAP theorem trade-offs. Indexing strategies for read optimization. Replication for availability. Sharding for write scaling. Object storage (S3) for files. CDN for static assets. Choose based on access patterns and consistency needs.
REST: resource-based, HTTP methods, stateless. GraphQL: flexible queries, single endpoint. gRPC: binary protocol, streaming, service definitions with protobuf. Async communication: message queues (Kafka, RabbitMQ, SQS) for decoupling, event-driven architecture. Webhooks for real-time notifications. API gateway for routing, auth, rate limiting.
Availability: redundancy, failover, health checks. Consistency: strong (CP systems) vs eventual (AP systems). Reliability patterns: circuit breaker, retry with backoff, bulkhead, timeout. Monitoring: metrics (Prometheus), logging (ELK), tracing (Jaeger, OpenTelemetry). SLOs define targets, SLIs measure them, error budgets balance reliability and velocity.
1 topic
Practice designing: URL shortener (hashing, databases, redirect), chat system (WebSockets, message queues, presence), news feed (fan-out, ranking, caching), notification service (pub/sub, delivery guarantees), rate limiter (token bucket, sliding window), file storage (chunking, deduplication, CDN), and search engine (inverted index, ranking). Framework: requirements → estimation → high-level design → deep dive → bottlenecks.