Introduction to System Design
System design is the process of defining the architecture, components and data flow of a system so that it meets its requirements at the required scale.
Scalability and Load Balancing
Design services to be stateless so any instance can handle any request; keep state in a database, cache or session store.
Caching
Caching stores copies of data in a faster location to cut latency and load.
Databases, Replication and Sharding
Synchronous replication gives stronger durability with higher latency; asynchronous is faster but followers can lag (replication lag), so a user may read…
Message Queues and Asynchronous Processing
Queues decouple producers from consumers so work can be buffered, retried and scaled independently.
API Design and Rate Limiting
Model resources with nouns and use HTTP methods for actions.
Reliability and Observability
Everything fails: disks, networks, whole zones. Aim to avoid single points of failure and to degrade gracefully.
Case Study: Design a URL Shortener
Design a URL shortener step by step: requirements, API, key generation, storage, caching, redirects and scaling. A classic interview problem.