Guided Lab Brief

Your First System

Build a basic client → server → database architecture from scratch and understand the 3-tier pattern.

Overview

Build a basic client → server → database architecture from scratch and understand the 3-tier pattern.

Every web application you use - from Google to Instagram - follows the same fundamental pattern: a Client sends a request, a Server processes it, and a Database stores the data.

You will build 3 architecture steps that model production dependencies.

You will run 3 failure experiments to observe bottlenecks and recovery behavior.

Success target: All components are connected, the API server has 2+ instances, and the simulation shows 95%+ success rate.

Learning Objectives

  • Understand the 3-tier client → server → database pattern
  • Know why each component exists and what it does
  • Learned about single points of failure and basic redundancy
  • Experienced how under-provisioning causes cascading failures

Experiments

  1. Let's see what happens when your API server can't handle the traffic. Lower the maxRps to simulate an underpowered server
  2. Now let's see what happens when your database runs out of connections. Lower maxConnections to a tiny number
  3. What if we only have 1 API server instance and it crashes

Failure Modes to Trigger

  • Trigger: Let's see what happens when your API server can't handle the traffic. Lower the maxRps to simulate an underpowered server

    Observe: With max 50 rps but 100 rps incoming, the server becomes overloaded. 50% of requests fail. Users see errors and slow loading times. In production, this causes a cascading failure as retry storms make things worse.

  • Trigger: Now let's see what happens when your database runs out of connections. Lower maxConnections to a tiny number

    Observe: With only 2 connections, most API server requests wait in a connection queue. Latency spikes from 10ms to seconds. Your API starts timing out. Users see 'connection refused' errors.

  • Trigger: What if we only have 1 API server instance and it crashes

    Observe: With a single instance, your server is a Single Point of Failure (SPOF). If it crashes, restarts, or needs updates, your entire application goes down. Zero redundancy means zero availability during failures.