Dashboard/System design/06. Building Blocks

SYSTEM DESIGN · LESSON 6 OF 52 · 4 MIN VIDEO · 1 TOPICS

Building Blocks

Module Progress (0 / 1 Lessons Completed)0%
System design Track (0 / 52 Modules) · Overall 0/80 (0%)0%
⌁

Narrated HD Video Lesson (4 min) · Pro

Lesson Overview + Section #01 + RESHADED Checklist + Quiz #1 are unlocked free below (no login required). Unlock all 80 HD video lessons and deep-dive sections — or watch our two free sample video lessons first.

0% READSec 01/01 · Introduction to Building Blocks for Modern System Design
SYSTEM DESIGN VIDEO LESSON & GUIDE

Building Blocks

Large-scale distributed systems are rarely designed from scratch; instead, they assemble a recurring catalog of 16 battle-tested infrastructure primitives—spanning edge routing, stateless compute, polyglot persistence, and asynchronous event pipelines—joined by domain-specific invariants. Mastering each building block's throughput ceiling, failure modes, and latency profile allows engineers to avoid reinventing plumbing and focus architectural capacity on the core bottlenecks that differentiate a system. In L4-L6 system design interviews, evaluators test whether candidates select the simplest set of primitives that satisfy quantitative non-functional targets (p99 latency, availability SLOs, and consistency guarantees) while articulating exact trade-offs at every boundary.

WHAT YOU WILL MASTER IN THIS LESSON
  • Decompose any high-scale product into synchronous request-path components and asynchronous background primitives with clear latency budgets
  • Justify why each of the 16 foundational building blocks exists by quantifying what breaks when traffic or storage outgrows a naive monolithic setup
  • Map distinct system archetypes—such as media streaming, real-time messaging, and geospatial dispatch—onto shared infrastructure components without over-engineering
SYSTEMATIC BUILDING-BLOCK CHECKLIST (FROM MODULE 01)

4-Point Infrastructure Primitive Audit

Check off each dimension as you study this building block—interviewers test what it solves, how it works inside, what it costs, and how it fails.

0 / 4 Checked
INTERVIEWER SCORECARD · WHAT MAKES A STRONG HIRE?

5 Signals Bar Raisers Grade (L4 vs. L5 Senior vs. L6 Staff)

Senior (L5 / E5 / Senior SDE) Bar — Autonomous Pacing, Depth & Proactive Trade-Offs: Owns the 45-minute clock without prompting, derives every component quantitatively, surfaces failure modes (hot shards, stampedes, dual writes) BEFORE being asked, and defends consistency vs. latency trade-offs.
1. Scoping
✓ STRONG HIRE SIGNAL

Clarifies users, read/write skew, p99 latency, consistency bounds, and explicit non-goals in minutes 2–8.

✗ NO-HIRE RED FLAG

Jumps straight into drawing load balancers and microservices at minute 2 without asking a single question.

2. Right-Sized Design
✓ STRONG HIRE SIGNAL

Starts with the simplest working architecture justified by the math (e.g., 1 NVMe SQL primary + replicas + Redis for 40 writes/s & 3 TB).

✗ NO-HIRE RED FLAG

Recites a memorized Kafka + multi-DC Cassandra diagram that contradicts their own traffic calculations.

3. Technical Depth
✓ STRONG HIRE SIGNAL

Drives deep into 1–2 hard bottlenecks (partition keys, hot-key mitigation, transactional outbox, KV-cache batching) at minute 27.

✗ NO-HIRE RED FLAG

Skims across 12 boxes at identical buzzword depth and runs out of time before the deep dive.

4. Explicit Trade-Offs
✓ STRONG HIRE SIGNAL

Uses 3-part reasoning: 'A queue here because SMTP spikes to 3 s; checkout stays <60 ms, and we accept eventual email delay + retry dedup.'

✗ NO-HIRE RED FLAG

Name-drops tools ('We put Kafka and ZooKeeper here') without stating the alternative or operational cost.

5. Communication
✓ STRONG HIRE SIGNAL

Thinks aloud every 30–45s, checks alignment at phase transitions, and treats 'What if X fails?' as a cue for where points are awarded.

✗ NO-HIRE RED FLAG

Goes silent for 5 minutes while drawing or defends a flawed assumption defensively when nudged.

ARCHITECTURE & DATA-FLOW SLIDES · SLIDE 1 OF 2Section 01: Introduction to Building Blocks for Modern System Design
ARCHITECTURE / DATA FLOW DIAGRAM
Clientphone app203.0.113.7DNSname to address100 per minuteRate limiterimages, scriptsCDNstatic files nearbyLoad balancerApp serversstatelessunder 1 msCachein memorySQL or key-valueDatabaselasting data
SECTION 01 OF 1

1. Introduction to Building Blocks for Modern System Design

★ FREE PREVIEW
Key Takeaway: Every planet-scale architecture is a composition of roughly 16 standard infrastructure building blocks; mastering their internal mechanics and failure trade-offs once lets you spend interview and engineering time exclusively on domain-specific constraints.
SECTION 01 DIAGRAMS · SLIDE 1 OF 2Introduction to Building Blocks for Modern System Design
ARCHITECTURE / DATA FLOW DIAGRAM
Clientphone app203.0.113.7DNSname to address100 per minuteRate limiterimages, scriptsCDNstatic files nearbyLoad balancerApp serversstatelessunder 1 msCachein memorySQL or key-valueDatabaselasting data

Why Composable Primitives Govern System Design

Modern internet services handle 100,000+ RPS and petabytes of state without bespoke networking or custom disk engines for every product feature. Instead, engineers treat infrastructure like standardized integrated circuits: each building block encapsulates one difficult distributed systems problem—such as global name resolution, hot-key caching, consensus-backed unique ID generation, or durable message buffering—behind a narrow contract. Studying these 16 primitives independently prevents premature coupling and lets an architect isolate where a design genuinely diverges from textbook patterns.

  • Separation of concerns: Decoupling ingress protection (Rate Limiter, Load Balancer) from business logic keeps App Servers stateless and horizontally replaceable.
  • Predictable failure domains: Standardized primitives expose well-understood degradation modes, such as stale reads during CDN or Cache invalidation versus write unavailability during strict database quorums.
  • Interview leverage: Naming a Sharded Counter or Sequencer with concrete throughput math immediately signals staff-level fluency, freeing time to deep-dive into custom workflow edge cases.
Interview Signal: Interviewers penalize 'kitchen-sink' diagrams where candidates drop a message queue, cache, and search cluster onto the board unprompted. Introduce a building block only after demonstrating with numbers why the simpler baseline violates a latency, throughput, or availability requirement.

The Synchronous Read and Ingress Path

Consider a mobile client opening a consumer photo-sharing feed. Before a single byte of application code executes, DNS translates the service hostname into a routable IP address, and static immutable assets (JPEG thumbnails, JavaScript bundles) are served directly from a geographically proximate CDN edge point-of-presence (10-30 ms RTT), offloading 85-95% of raw egress bandwidth from origin data centers. Dynamic API calls traverse a Rate Limiter—which enforces per-user or per-IP token buckets to block abusive floods—followed by a Load Balancer that routes across healthy, stateless App Servers. To avoid hitting disk on every read (5-20 ms per query), servers query an in-memory Distributed Cache (0.5-1 ms RTT) first and fall back to the durable Database only on cache misses.

Request-Path BlockCore ResponsibilityTypical Latency / Scale ImpactFailure Mode Without It
DNSResolves human-readable domain names to edge or VIP addresses< 1 ms cached; 20-120 ms cold lookupClients hardcode brittle server IPs; zero transparent failover
CDNCaches static and cacheable media at global edge POPs10-30 ms edge delivery; 90%+ origin bandwidth offloadOrigin egress saturates; cross-continent RTT (200+ ms) degrades UX
Rate LimiterCaps request rate per user, API key, or IP subnet< 1 ms check via local or Redis token bucketSingle noisy neighbor or botnet starves shared compute pool
Load BalancerDistributes traffic across healthy instances behind one VIP100,000+ RPS per L7 node; < 5 s health-check ejectionSingle-server throughput ceiling; dead hosts blackhole client traffic
Distributed CacheStores hot working-set records in clustered RAM0.5-1 ms p99 read latency at 95%+ hit ratioDatabase CPU/IOPS melts under skewed read-heavy traffic
Database (SQL / KV)Persists authoritative state with ACID or tunable quorum guarantees2-15 ms SSD point query; terabytes to petabytesPermanent data loss or race-condition corruption on concurrent writes
Client -> DNS (cached VIP) -> Rate Limiter (HTTP 429 if > 100 req/min)
       -> Load Balancer -> Stateless App Server
       -> Cache GET feed:user_42 (Hit: ~0.8 ms -> return 200 OK)
       -> [On Cache Miss] Database SELECT (~8 ms) -> Populate Cache -> return 200 OK

The Asynchronous Write Path and Specialized Primitives

Uploading a high-resolution photo exercises the backend building blocks behind the stateless application tier. First, a Sequencer mints a globally unique, roughly time-ordered 64-bit post ID across thousands of concurrent writers without coordinating through a single database auto-increment lock. Raw 4-8 MB image binaries bypass the transactional database entirely and land in an object Blob Store engineered for eleven-nines (99.999999999%) durability at low cost per gigabyte. Because transcoding multiple thumbnail resolutions takes 2-5 s of CPU work, the app server enqueues a job onto a Message Queue and returns 202 Accepted in < 150 ms, letting a Distributed Task Scheduler dispatch, lease, and retry worker executions asynchronously.

  • Pub-Sub messaging: Broadcasts a single PhotoPublished event independently to timeline fan-out workers, push notification pipelines, and trust-and-safety classifiers without coupling the upload service to downstream consumers.
  • Distributed search: Maintains partitioned inverted indexes across shards so full-text tag and caption queries return ranked matches in < 50 ms without LIKE '%tag%' full-table scans.
  • Sharded counters: Splits a viral post receiving 20,000 likes/s across N independent sub-shards (for example, 64 shards absorbing ~312 writes/s each) to eliminate single-row lock contention, aggregating the sum on read or background flush.
  • Monitoring and distributed logging: Collects time-series metrics, structured logs, and trace spans across all blocks so engineers detect elevated 5xx rates or queue consumer lag via automated alerts before customer-visible outages escalate.

Reusing the 16 Building Blocks Across System Archetypes

Studying building blocks individually pays compounding dividends because radically different consumer products rely on the exact same underlying components configured for different read/write ratios and consistency models. A video platform optimizes egress throughput via CDN and Blob Store, a chat platform optimizes ordering and stateful delivery via Sequencer and Key-Value Store, and a ride-hailing dispatch engine optimizes high-frequency ephemeral ingestion (1 update / 4 s per active driver) via Pub-Sub and in-memory geospatial Cache. Once the standard blocks are wired together, 80% of the architecture is structurally complete, exposing the 20% of custom protocol design that defines the interview.

System ArchetypePrimary Building BlocksDominant Workload CharacteristicSignature Design Customizations
Video Streaming ServiceCDN, Blob Store, Database, Distributed Search, Task SchedulerExtreme egress bandwidth (Tbps), multi-bitrate transcodingAdaptive bitrate (HLS/DASH) chunking and ISP-colocated edge caching
Real-Time Chat ServiceMessage Queue, Key-Value Store, Sequencer, Distributed CacheStateful bidirectional sockets, strict per-conversation orderingPer-channel sequence numbers and WebSocket session-to-gateway registry
Ride-Hailing ServicePub-Sub, Distributed Cache, Database, Monitoring, Load BalancerHigh-velocity ephemeral location writes, low-latency spatial matchingGeohash / H3 spatial indexing in memory with ACID trip-state ledger
ACTIVE RECALL & TRADE-OFF PROBES

System Design Checkpoint Quizzes (1)

CHECKPOINT QUIZ #1

In "Introduction to Building Blocks for Modern System Design" (The Synchronous Read and Ingress Path), how does a production-grade design handle "CDN" (Failure Mode Without It)?