CodeWithYash
DSA
Spring Boot
System Design
Series
Articles
Leaderboard
Sign In

Subscribe to Newsletter

Get the latest articles, DSA sheets, and system design challenges delivered to your inbox.

<CODEWITHYASH/>

The ultimate sanctuary for software engineers seeking deep mastery of core technical principles.

Library

  • Articles
  • DSA Sheets
  • Roadmaps

Connect

  • GitHub
  • LinkedIn
  • About
  • Contact

Legal

  • Privacy
  • Terms
  • Support

© 2026 CodeWithYash Global Systems.

Status: OperationalVersion: 4.2.0
System Design
OverviewTheory lessonsHLDLLD
All SeriesSeries
Distributed Systems
All System Design modules

Module 2 · Component Architecture

Core Infrastructure Building Blocks

The internal mechanics, scaling boundaries, and failure modes of infrastructure primitives: load balancers, API gateways, caches, CDNs, storage engines, and message brokers.

10 lessons available·300 minutes
Start module

Lesson plan

What you will learn

01Load Balancers & Reverse ProxiesDeep dive into Layer 4 (TCP) vs Layer 7 (HTTP) traffic balancing, routing algorithms (Round Robin, Least Connections, P2C), and active vs passive health checks. 25 min02API Gateways & Edge RoutingMaster edge gateway responsibilities: JWT/OAuth2 authentication, request transformation, dynamic route lookup, rate limiting, and distributed tracing propagation. 35 min03Caching Architecture & Critical PathologiesImplement cache-aside, read-through, write-through, and write-back patterns while mitigating stampedes, avalanches, penetrations, and hot-key skew. 30 min04Consistent Hashing & Virtual NodesDistribute keys across dynamic server clusters with minimal remapping on node joins or departures using hash rings and virtual nodes. 25 min05Content Delivery Networks (CDNs) & Anycast RoutingLearn how BGP Anycast and Geo-DNS route users to edge points of presence (POPs), static vs dynamic asset caching, origin shielding, and stale-while-revalidate headers. 35 min06Storage Engines: B-Trees vs. LSM-TreesUnpack the low-level disk mechanics of in-place B+Trees (PostgreSQL/MySQL) versus append-only Log-Structured Merge-Trees (RocksDB/Cassandra), comparing write amplification and compaction. 30 min07SQL vs. NoSQL & Data Model SelectionA decision framework for selecting between Relational (Postgres), Key-Value (Redis), Document (Mongo), Wide-Column (Cassandra), Columnar/OLAP (ClickHouse), and Graph (Neo4j). 35 min08Database Scaling: Sharding, Partitioning & ReplicationMaster horizontal database scaling: Single-Leader vs Leaderless replication, replication lag anomalies, sharding strategies, and Consistent Hashing with virtual nodes. 30 min09Message Brokers, Event Streaming & Task QueuesDissect traditional message queues (RabbitMQ/SQS) versus distributed partitioned append-only event logs (Kafka/Redpanda), exploring zero-copy socket transfer and consumer offsets. 30 min10Rate Limiters & Traffic ShapingCompare rate limiting algorithms (Token Bucket, Leaky Bucket, Fixed Window, Sliding Window Counter), and design a high-throughput distributed limiter using Redis Lua scripts. 25 min

Module outcome

Design fault-tolerant ingress routing, prevent cache stampedes and avalanches, choose optimal storage engines (B-Tree vs LSM), and partition data with consistent hashing.

Prerequisite

Module 1 (Foundations & Mental Models) or solid knowledge of network latency and Little’s Law.

Mental model

Infrastructure components are specialized trade-off engines. Caches trade memory for read latency; message brokers trade immediate execution for durable decoupling; load balancers trade hop latency for horizontal throughput.

Module challenge

High-Throughput Ingress & Storage Architecture

Architect an end-to-end data pipeline capable of ingesting 200,000 writes/sec, routing through an L4/L7 balancer tier, caching reads via Redis Cluster, and persisting to an LSM-tree database.

  • Size the Redis cache cluster to store 20% working set under the 80/20 Pareto principle.
  • Configure consistent hashing with virtual nodes to balance key distribution within 3% standard deviation.
  • Design a dead-letter queue (DLQ) and retry backoff workflow to prevent broker head-of-line blocking.

Course baseline

System Design 2026.1

Reviewed 2026-09-14

Previous module Foundations & Mental ModelsNext moduleDistributed Systems Mechanics & Reliability