01

The Interplay Between Software and Hardware

When designing a system for reliability, performance, and scalability, both software and hardware must work together.

02

A Startup’s Journey from Home Garage to Global Infrastructure

Imagine a startup founder building a web application.

The app runs on a general-purpose server installed in their home garage.

It accepts HTTP requests from users worldwide, processes them, and stores data in a database.

Initially, both the web app and database run on the same physical server.

As traffic grows, the web app becomes CPU-bound, requiring more processing power.

The database, meanwhile, demands large amounts of memory and disk space.

A single server with balanced resources becomes expensive.

Splitting the workload improves cost efficiency.

Buy two servers: one compute-optimized with high-performance processors.

One storage-optimized with ample memory and disk space.

Move the database to its own dedicated server.

This setup functions well for a while.

03

First Physical Reliability Improvement

One day, the founder’s dog turns off the application server.

This event reveals a critical vulnerability: single-point failure.

To address this:

  • Purchase a server rack.

  • Install both servers inside the rack.

  • Secure the rack away from pets.

  • Add a third server: one application server, one small load balancer.

The load balancer distributes incoming requests across the application servers.

To ensure data durability:

  • Buy an additional database server.

  • Implement data replication and automated backups.

This setup remains stable for a while.

04

Second Physical Failure Event

A power outage in the area causes all servers to shut down.

This reveals another failure point: location-dependent power.

To improve resilience:

  • Move one application server and the secondary database server to a friend’s garage.

  • The friend’s garage is several blocks away.

  • This creates a geographically distributed system.

If servers in the founder’s garage fail, the system remains available.

The friend’s garage servers continue serving users.

This design reduces the risk of total system failure.

The setup incurs additional costs: one more rack, one more load balancer.

05

Performance Gaps by Geography

Users in India report poor performance.

Latency between India and the US is high.

To address this:

  • Contact friends in India.

  • Ask them to build an identical infrastructure.

  • Serve India users from India.

This reduces latency and improves user experience.

06

Remaining System Limitations

The system still has a single point of failure: the database.

Only one database server handles user requests.

The secondary database server replicates data for durability.

It does not serve user requests.

If the primary database fails, the secondary must become primary.

This transition requires a well-defined failover mechanism.

This issue will be discussed in later sections.

07

Core Insight for System Design

To build highly available, performant, scalable, and durable distributed systems:

  • Software design principles are essential.

  • Infrastructure design is equally critical.

  • Software engineers must understand both layers.

  • Only a few key infrastructure concepts are needed.

These include physical location, redundancy, and geographic distribution.

Understanding these enables engineers to build resilient systems without overcomplicating the design.

08

Servers: Core Components and Scaling

Servers have four key parameters: CPU, memory size, disk size, and network bandwidth.

Each component of a system determines the server resources it needs.

Among these, CPU is the easiest to scale.

Network bandwidth is typically the hardest to scale.

09

Server Racks: Physical Grouping and Function

Multiple servers are mounted within a server rack.

Racks simplify server access, inspection, and physical manipulation.

Racks improve cooling efficiency and allow physical locking for enhanced security.

Each rack typically has its own dedicated network and power source.

While system designers usually don’t prioritize racks, exceptions exist.

We may want servers in different racks to ensure availability.

If one rack fails, spare hardware in other racks maintains system operation.

Alternatively, we may place all servers in a single rack to minimize communication latency.

This choice trades performance for availability.

10

Data Centers: Physical Infrastructure

A data center is a building housing many server racks.

It includes independent power, cooling, and physical security.

It functions like a startup’s garage but at a much higher cost.

A data center can become completely unavailable due to events like power outages, lightning strikes, tornadoes, or earthquakes.

When a startup’s garage loses power, servers are moved to a friend’s garage.

The same principle applies to data centers.

This concept is known as an availability zone.

11

Availability Zones: Geographic Isolation

An availability zone consists of one or more discrete data centers.

Each has independent power and networking.

Availability zones ensure high availability and scalability.

Instead of concentrating all hardware in a single data center, servers are distributed across multiple data centers.

If one data center fails or lacks capacity, systems can rely on others in the same availability zone.

12

Regions: Geographic Groupings

A region is a group of isolated, physically separate availability zones.

Regions are spread across geographic areas.

For example, US and India represent two distinct regions.

A single country may contain multiple regions.

For instance, US East Coast and US West Coast are separate regions.

Each region typically includes at least two availability zones.

Availability zones are within a 100 km radius of each other.

AZs in a region are connected via high-bandwidth, low-latency networks.

Network latency between AZs is less than 2 ms.

13

System Deployment Structure

Regions are spread globally.

Each region contains one or more availability zones.

Each availability zone contains one or more data centers.

Each data center holds many server racks.

Each rack mounts multiple servers.

Servers come in different types:

  • Compute-optimized: many CPU cores

  • Memory-optimized: large RAM

  • Storage-optimized: high local disk throughput for reads and writes

When designing a system, non-functional requirements must consider deployment location and configuration.

Deployment decisions shape system availability, performance, and resilience.

14

Global Deployment: Regions

To achieve worldwide scale, deploy a system copy in every region.

This improves performance by reducing latency—users access the system from a location physically closer to them.

It increases availability because if one entire region fails, user requests can be routed to other regions.

It enhances scalability by providing access to more hardware resources across regions.

15

Regional Availability Zones

Within each region, deploy the system across multiple availability zones.

This boosts system availability—failure in one zone does not bring down the entire system.

It improves scalability by distributing workloads across zones.

It increases data durability through rapid replication between zones.

16

Data Center-Level Racks

Within each data center, deploy services across different server racks if high availability is required.

This provides redundancy at the physical level, minimizing single-point failures.

17

Component-Specific Workload Optimization

Different system components—such as microservices—should be deployed on servers optimized for their specific workload.

Workload characteristics include:

  • Compute requirements
  • Memory usage
  • Disk storage needs
  • Networking demands

Each component must be matched to server hardware that best supports its operational profile.

This ensures efficient resource utilization and performance consistency across the global system.

Questions

  • What are the four key parameters of a server, and which one is easiest and which is hardest to scale?
  • Why might a system designer want to place servers in different racks within a data center?
  • How does a power outage in one data center affect system availability, and what is the solution proposed in the transcript?
  • What is the difference between a data center and an availability zone, and how are they related?
  • Why is it important to deploy a system in multiple regions, and what are the benefits for users in different geographic areas?
  • What happens if the primary database server fails, and how is this problem addressed in the transcript?
  • How does the placement of servers in a single rack versus multiple racks affect system reliability?
  • What role does a load balancer play in the system, and how is it deployed in the example?

Key takeaways

  • Servers have four key parameters: CPU, memory, disk size, and network bandwidth. Each component is chosen based on its resource needs.
  • CPU is the easiest parameter to scale, while network bandwidth is typically the hardest to scale.
  • Server racks allow physical organization, maintenance, cooling, and security, and can be used to isolate hardware for reliability.
  • Data centers contain many racks and have independent power, cooling, and physical security—like a garage but larger and more expensive.
  • An availability zone is one or more discrete data centers with independent power and networking, helping ensure high availability.
  • A region consists of one or more availability zones, and regions are spread across geographic areas like US East and West Coast.
  • AZs within a region are typically within 100 km of each other and connected with low-latency, high-bandwidth networking.
  • Deploying systems across multiple regions improves performance, availability, and scalability by reducing latency and providing redundancy.
  • Different components of a system (e.g., microservices) should be deployed on servers optimized for their specific workloads (compute, memory, disk, networking).