# System Design Crash Course: From CPU Cache to Load Balancers and Sharding

Key points from freeCodeCamp's system design course: availability and SLAs, CAP, networking, API design, caching, CDNs, proxies, load balancers and database scaling.

- Source: https://raleche.com/story/freecodecamp-system-design-concepts-course
- Published: 2026-11-17
- Author: Tech Team Strategy (RALECHE)
- Speaker: Hayk Simonyan
- Tags: freeCodeCamp, Hayk Simonyan, System Design, CAP Theorem, API Design, Caching, Load Balancing, Databases, Interviews

> An executive summary of this story is available to members at https://raleche.com/story/freecodecamp-system-design-concepts-course.

---

> Watch the original interview: [YouTube](https://www.youtube.com/watch?v=F2FmTdLtb_4)

This hour-long **freeCodeCamp** course by **Hayk Simonyan** covers the system design concepts you need for an interview, where, as he puts it, nobody wants to see you write code, only how you "glue an entire system together." It runs from the parts inside one computer to production architecture, design requirements, networking, protocols, APIs, caching, proxies, load balancers and databases. Here are the main points from each section.

This article is our own summary, with short quotes, from the video's automatic transcript. Watch the full video above for everything that was said.

## The short version

-   **Good design** means scalability, maintainability and efficiency, and planning for failure. At its heart are moving, storing and transforming data.
-   **Every decision is a trade-off.** The CAP theorem says a distributed system can achieve only two of consistency, availability and partition tolerance at once.
-   **Measure what matters:** availability (99.9% allows about 8.76 hours of downtime a year; 99.999% about 5 minutes), SLOs and SLAs, throughput and latency.
-   **Get the design right early.** Unlike code, a system is very hard to redesign later.
-   **Caching, CDNs, proxies and load balancers** are the main tools for speed and reliability; **sharding, replication, indexing and query optimization** for databases.

## Inside one computer

Data lives on disk (non-volatile; an SSD reads around 500 to 3,500 MB per second, a hard drive about 80 to 160), in RAM (volatile, often above 5,000 MB per second) and in the CPU's L1, L2 and L3 caches (a few nanoseconds). The CPU runs compiled machine code; the motherboard connects everything.

## A production app

-   **CI/CD** (Jenkins, GitHub Actions) moves code from repository to production through tests with no manual steps.
-   **Load balancers and reverse proxies** like Nginx spread traffic; storage runs on separate servers.
-   **Logging and monitoring** (PM2 on the back end, Sentry on the front end) feed alerts, often into a Slack channel.
-   **Debugging:** find the issue in the logs, reproduce it in staging ("never debug directly in the production environment"), then ship a hotfix before a permanent fix.

## Design requirements

-   **CAP theorem** (Eric Brewer): consistency (every node has the same data), availability (always responsive) and partition tolerance (works despite network splits). A bank favors consistency and partition tolerance, even if some transactions are slower.
-   **Availability and SLAs:** an SLO might say 99.9% of requests answer within 300 milliseconds; an SLA is a contract, and missing it can mean refunds.
-   **Resilience:** redundancy, fault tolerance and graceful degradation.
-   **Throughput** (requests per second, queries per second, bytes per second) versus **latency** (time for one request). Batching raises throughput but can add latency.

## Networking

IPv4 addresses are 32-bit (about 4 billion); IPv6 is 128-bit. Packets carry IP headers. **TCP** is reliable, with sequence numbers and a three-way handshake; **UDP** is faster but unreliable, fine for video calls and live streaming. **DNS** is the internet's phone book, overseen by ICANN, with A records (IPv4) and AAAA records (IPv6). Firewalls guard networks; ports identify services (80 for HTTP, 22 for SSH).

## Application protocols

HTTP is stateless request-response with status codes (200s success, 300s redirect, 400s client error, 500s server error) and methods (GET, POST, PUT, PATCH, DELETE). **WebSockets** give two-way real-time updates for chat, sports scores and stock feeds. Also covered: SMTP, IMAP and POP3 for email; FTP and SSH; **WebRTC** for browser video calls; **MQTT** for low-power IoT devices; **AMQP** for enterprise messaging (as in RabbitMQ); and **RPC**, calling a remote function as if it were local.

## API design

Using a Shopify-style e-commerce API, he maps CRUD to endpoints (POST, GET, PUT/PATCH, DELETE on /api/products). **REST** is stateless and widely consumable but can over- or under-fetch. **GraphQL** returns exactly what's asked but complex queries can strain the server. **gRPC** runs on HTTP/2 with protocol buffers, efficient for microservices but less readable. Best practices: nested endpoints for relationships (/users/{id}/orders), pagination and filters (limit, offset, date ranges), GET requests that are idempotent and never change data, versioning (v1, v2) for backward compatibility, rate limiting against DDoS attacks, and CORS settings.

## Caching and CDNs

A site hosted in Finland may load in about 100 milliseconds in Europe but 3 to 5 seconds in Mexico. Caching keeps copies closer: **browser caching** (controlled by the Cache-Control header), **server caching** (in memory, such as Redis), **database caching** and **CDNs**. Write strategies are write-around, write-through (consistent but slower) and write-back (fast but risks loss on a crash). Eviction policies are LRU, FIFO and LFU. Pull CDNs fetch from the origin on first request; push CDNs suit large, rarely updated files. CDNs cut latency, add availability and offer security such as DDoS protection; dynamic and real-time content still hits the origin.

## Proxies and load balancers

A **forward proxy** sits in front of clients, hiding their IP, controlling and monitoring access, caching, and anonymizing browsing. A **reverse proxy** sits in front of servers: load balancers, CDNs, web application firewalls, SSL offloading. Load-balancing algorithms: round robin, least connections, least response time, IP hashing (session persistence), weighted variants, geographic routing and consistent hashing on a hash ring. Health checks stop traffic to failed servers. Options include F5 BIG-IP and Citrix hardware, HAProxy and Nginx software, and AWS, Azure and Google Cloud services. A load balancer is itself a single point of failure, so run redundant pairs with failover, monitor it, auto-scale and self-heal, or use DNS failover.

## Databases

**Relational** databases (PostgreSQL, MySQL, SQLite) are ACID-compliant: atomicity, consistency, isolation, durability. **NoSQL** (MongoDB, Cassandra, Redis, Neo4j) is schema-less and suits unstructured data and scale. **In-memory** databases (Redis, Memcached) are for caching and sessions. Scale **vertically** (bigger machine, limited) or **horizontally** with **sharding** (range-based, directory-based or geographic) and **replication** (master-slave or master-master). To go faster: caching, **indexing** frequently queried columns, and **query optimization**, such as minimizing joins and using EXPLAIN plans.

## What it means for your business

1.  **Write down availability targets.** The gap between 99.9% and 99.999% is hours of downtime versus minutes, and very different costs.
2.  **Automate deployments and alerts.** CI/CD plus alerts to a team channel shortens outages.
3.  **Version your APIs and rate-limit them** to protect customers and your servers.
4.  **Cache and use a CDN** for customers far from your servers.
5.  **Never run a single load balancer or database** where downtime costs money.

## Video details

-   **Title:** System Design Concepts Course and Interview Prep
-   **Instructor:** Hayk Simonyan
-   **Published by:** freeCodeCamp.org on YouTube
-   **Watch:** [youtube.com/watch?v=F2FmTdLtb\_4](https://www.youtube.com/watch?v=F2FmTdLtb_4)
-   **Note:** figures and quotes come from the video's automatic transcript and are lightly cleaned. Check the video for exact wording.

## Want to put this to work?

We help owners turn AI trends into a plan, a product and a launch. [Book a free call](https://calendly.com/davidraleche/30min) or [see our services](https://tech-team-strategy.com/services).
