githubEdit

Building Blocks

Fundamental components used in almost every large-scale system. Each building block is a standalone deep dive with architecture, trade-offs, and real-world examples.

Index

Building Block
Description
When to Use

Distribute traffic across multiple servers

Multiple app instances, high availability

Single entry point; SSL termination, routing, caching

Fronting app servers, API gateway

Edge caching for static/dynamic content

Low-latency global delivery

In-memory cache (e.g. Redis) for hot data

Read-heavy, latency-sensitive

Queues and pub/sub for async processing

Decoupling, async jobs, events

Find service instances in a dynamic cluster

Microservices, containers

Single entry for APIs; auth, rate limit, routing

Microservices, B2B APIs

Coordinate exclusive access across nodes

Leader election, critical sections

Limit requests per user/IP/key

Abuse prevention, fairness, cost control

Partition data across multiple databases

Write scale, storage scale

Copy data across nodes for availability and read scale

HA, read scaling

How to Use

  • Interview prep: Read each doc for concept overview, trade-offs, and real-world examples.

  • Quick revision: Use the "Quick Revision" section at the end of each doc.

  • Design discussions: Reference "When to use / When not to use" and "Failure scenarios."

Last updated