Software Development

System Design Basics: How to Build Scalable Systems

December 5, 2026 · 11 min read

System Design Basics: How to Build Scalable Systems

System design is the process of deciding how the parts of a software system fit together so it meets its goals: serving users quickly, staying available when things fail, protecting data and growing without a rewrite. It covers the big decisions that are expensive to change later, such as how data is stored and shared, where caching happens, how services talk to each other and how the system copes with ten or a thousand times more traffic.

The scale some systems reach shows why these decisions matter. Over Black Friday and Cyber Monday 2025, Shopify's platform peaked at 489 million requests per minute at the edge, handling 14.8 trillion database queries over the weekend. Most applications will never see that load, but the same principles apply at every size. This guide explains system design basics for developers and founders: requirements, estimation, the core building blocks, how systems scale step by step, the trade-offs involved and a framework you can use in interviews, with two tested code examples.

Start with Requirements, Not Technology

Good system design begins with questions rather than diagrams. Functional requirements describe what the system must do: users can create short links, links redirect to the original URL, owners can see click statistics. Non-functional requirements describe how well it must do it:

  • Scale: how many users, requests and records, today and in two years?
  • Latency: how fast must responses be? Measure the 95th or 99th percentile, not just the average.
  • Availability: 99.9% availability still allows about 43 minutes of downtime in a 30-day month; 99.99% allows about four minutes, and costs far more to achieve.
  • Consistency: must every user see a change immediately, or is a delay of a few seconds acceptable?
  • Durability, security and compliance: what data must never be lost, who may see it and where must it be stored?
  • Cost and team: what can the business afford to run, and what can the team realistically operate?

Back-of-the-Envelope Estimation

Before choosing technology, estimate the load. Rough numbers reveal whether you need one server or fifty, and whether the bottleneck will be reads, writes, storage or bandwidth. This script sizes a URL shortener; every input is an assumption you would refine with real data:

# estimate.py: back-of-the-envelope sizing for a URL shortener (all inputs are assumptions)
import math

new_links_per_month = 100_000_000
read_write_ratio = 100           # each link is opened 100 times on average
bytes_per_link = 500             # short code, long URL, owner, timestamps, indexes
retention_years = 5
peak_factor = 3                  # busiest hour versus the daily average
cache_share = 0.2                # cache the hottest 20% of each day's reads
requests_per_server = 2_000      # what one app server handles in a load test

seconds_per_month = 30 * 24 * 3600
writes_per_sec = new_links_per_month / seconds_per_month
reads_per_sec = writes_per_sec * read_write_ratio
storage_tb = new_links_per_month * 12 * retention_years * bytes_per_link / 1e12
cache_gb = reads_per_sec * 86_400 * cache_share * bytes_per_link / 1e9
peak_reads = reads_per_sec * peak_factor
servers = math.ceil(peak_reads / requests_per_server) + 1   # +1 so one server can fail

rows = [
    ("Writes per second (average / peak)", f"{writes_per_sec:,.0f} / {writes_per_sec * peak_factor:,.0f}"),
    ("Reads per second (average / peak)", f"{reads_per_sec:,.0f} / {peak_reads:,.0f}"),
    (f"Storage after {retention_years} years", f"{storage_tb:,.1f} TB"),
    ("Cache for hot links", f"{cache_gb:,.0f} GB"),
    ("Outgoing data at peak", f"{peak_reads * bytes_per_link / 1e6:,.1f} MB/s"),
    ("App servers at peak (N+1)", f"{servers}"),
]
for label, value in rows:
    print(f"{label:<38}{value}")

Output:

Writes per second (average / peak)    39 / 116
Reads per second (average / peak)     3,858 / 11,574
Storage after 5 years                 3.0 TB
Cache for hot links                   33 GB
Outgoing data at peak                 5.8 MB/s
App servers at peak (N+1)             7

The estimate immediately shapes the design. Reads outnumber writes 100 to 1, so caching and read replicas matter more than write throughput. Five years of links fit comfortably in one well-sized database, so sharding can wait. A cache of tens of gigabytes fits in memory on a single cache cluster, and a handful of stateless app servers behind a load balancer can absorb the peak with room for one to fail.

The Building Blocks of Scalable Systems

ComponentWhat it doesLearn more
Load balancerSpreads requests across servers and removes unhealthy onesLoad balancing
CDNServes static files and cached pages from locations near usersWhat is a CDN?
CacheKeeps hot data in memory to avoid repeated database workRedis caching
DatabaseStores the system of record; replicated for safety and reads, sharded for very large scaleSharding vs replication
Message queueMoves slow work, such as emails or video processing, out of the request pathKafka, RabbitMQ, SQS
Object storageHolds files, images and backups cheaply and durablyS3-compatible storage
Search indexFull-text and filtered search that databases do poorlyElasticsearch, OpenSearch
ObservabilityMetrics, logs and traces that show what the system is doingObservability vs monitoring

How Systems Scale, Step by Step

  1. One server runs the app and the database. Perfect for a prototype or an MVP.
  2. Separate the database onto its own machine or a managed service, with automated backups.
  3. Add a CDN and a cache to take repeated reads off the app and database.
  4. Run several stateless app servers behind a load balancer. Store sessions in a shared cache or use tokens, so any server can handle any request.
  5. Add database read replicas for read-heavy workloads.
  6. Move slow work to queues and background workers, so user requests stay fast.
  7. Split by domain into separate services only when teams or scaling needs demand it; our guide to microservices vs monoliths covers when that pays off.
  8. Shard data and go multi-region when a single primary database or region can no longer cope.

Each step adds cost and complexity, so take it when measurements say you need it, not before.

Protecting the System: Rate Limiting

Every public API needs a way to stop one client from overwhelming it, whether through a bug, a scraper or an attack. A token bucket is the most common approach: each client gets a bucket that refills at a steady rate, short bursts are allowed, and sustained overuse is rejected with HTTP 429. This simulation uses a virtual clock so the results are repeatable:

// rate-limiter.mjs: a token bucket per client allows short bursts but caps the sustained rate
class TokenBucket {
  constructor(capacity, refillPerSecond, now) {
    this.capacity = capacity;
    this.refillPerSecond = refillPerSecond;
    this.tokens = capacity;          // start full, so a new client can burst
    this.lastRefill = now;
  }
  allow(now) {
    const elapsedSeconds = (now - this.lastRefill) / 1000;
    this.tokens = Math.min(this.capacity, this.tokens + elapsedSeconds * this.refillPerSecond);
    this.lastRefill = now;
    if (this.tokens < 1) return false;   // would answer HTTP 429 Too Many Requests
    this.tokens -= 1;
    return true;
  }
}

const buckets = new Map();               // in production this state lives in Redis, shared by every server
function handle(clientId, now) {
  if (!buckets.has(clientId)) buckets.set(clientId, new TokenBucket(10, 5, now));
  return buckets.get(clientId).allow(now) ? 200 : 429;
}

function simulate(label, clientId, times) {
  const results = times.map((t) => handle(clientId, t));
  const ok = results.filter((code) => code === 200).length;
  console.log(`${label.padEnd(40)} ${ok} allowed, ${results.length - ok} rejected with 429`);
}

simulate("burst of 25 requests at 0 ms", "scraper", Array(25).fill(0));
simulate("10 more requests at 1,000 ms", "scraper", Array(10).fill(1000));
simulate("steady: 1 request every 250 ms for 10 s", "mobile-app", Array.from({ length: 40 }, (_, i) => i * 250));

Output:

burst of 25 requests at 0 ms             10 allowed, 15 rejected with 429
10 more requests at 1,000 ms             5 allowed, 5 rejected with 429
steady: 1 request every 250 ms for 10 s  40 allowed, 0 rejected with 429

The scraper's burst is capped at the bucket size, and after a second it has earned only five more requests, while the well-behaved mobile app, at four requests a second, is never affected. In production, the bucket state lives in a shared store such as Redis so every server enforces the same limit, and the response includes a Retry-After header.

The Trade-offs at the Heart of System Design

  • Consistency vs availability: the CAP theorem says that during a network partition, a distributed system must choose between returning possibly stale data and refusing to answer. Banking ledgers choose consistency; social feeds usually choose availability.
  • Latency vs consistency: even without failures, waiting for every replica to confirm a write is slower. Many systems accept eventual consistency for speed.
  • Synchronous vs asynchronous: queues make systems resilient and fast for users, but add delay and complexity in tracking work.
  • SQL vs NoSQL: relational databases offer transactions and flexible queries; some NoSQL stores scale writes more easily for specific access patterns.
  • Protocols: REST, GraphQL and gRPC suit different clients, as our comparison of REST vs GraphQL vs gRPC explains.
  • Code organisation: how you split repositories affects how quickly teams can change shared contracts; see monorepo vs polyrepo.
  • Build vs buy: managed services cost more per unit but save operational effort that small teams rarely have.

Design for Failure

At scale, something is always failing. Resilient systems assume it. Set timeouts on every network call, retry with exponential backoff and jitter, and make operations idempotent so a retried payment is not charged twice. Use circuit breakers to stop calling a struggling dependency, health checks so load balancers can remove bad instances, and graceful degradation, such as showing cached recommendations when the recommendation service is down. Define service level objectives, alert on them, and rehearse failures. Shopify, for example, describes running load tests that simulate 150% of the previous year's peak before its busiest weekend. Our guide to site reliability engineering goes deeper.

Common System Design Mistakes

  • Designing for imaginary scale. Microservices, Kubernetes and sharding on day one slow small teams down; design the next step, not the final one.
  • Neglecting the data model. Data outlives code. A poor schema or the wrong partition key is the hardest thing to change later.
  • Single points of failure: one database without replicas, one region, or one person who knows how deployments work.
  • No limits. Unbounded queues, uncapped API usage and calls without timeouts turn small incidents into outages.
  • Caching without an invalidation plan, so users see stale prices, stock levels or permissions.
  • Flying blind. Without metrics, logs and traces, you cannot tell whether a design works until customers complain.

A Framework for System Design Interviews

  1. Clarify requirements and agree what is in and out of scope.
  2. Estimate scale: users, requests per second, storage and bandwidth.
  3. Define the API and the core data model.
  4. Sketch the high-level design: clients, load balancer, services, data stores, cache and queues.
  5. Deep-dive into the hardest part, such as generating unique IDs, fan-out of feeds or hot keys.
  6. Discuss bottlenecks, failures and trade-offs, and how you would monitor the system.

Interviewers care more about your reasoning than a perfect diagram. Strong fundamentals help; our data structures and algorithms roadmap covers the hashing, trees and graphs that system design builds on.

Choosing Technology for Scalable Services

Most scalability problems are solved by architecture, not language choice, but some tools make the job easier. Go is popular for high-throughput network services because of its lightweight concurrency and small deployable binaries; our Golang tutorial builds a first API. Node.js suits I/O-heavy APIs and real-time features, and managed cloud databases, caches and queues let small teams run systems that would once have needed a dedicated operations team. For spiky or unpredictable workloads, serverless architecture can remove capacity planning altogether, at the cost of less control over cold starts and long-running work. Whatever you choose, prefer boring, well-understood technology for the core of the system, and save experiments for the edges where failure is cheap.

Frequently Asked Questions

What is system design?

System design is the process of defining the architecture, components, data flows and trade-offs of a software system so it meets requirements for features, performance, reliability, security and cost.

How do I start learning system design?

Learn the building blocks first: load balancers, caches, databases, replication, queues and CDNs. Then study how real systems work, practise designing common products such as a URL shortener or chat app, and always start from requirements.

What is the difference between high-level and low-level design?

High-level design describes the major components and how they interact. Low-level design covers the details inside a component, such as classes, database schemas, APIs and algorithms.

What is horizontal vs vertical scaling?

Vertical scaling makes one machine more powerful. Horizontal scaling adds more machines and spreads the load between them, which scales further and improves availability but requires stateless services or shared state.

Why are back-of-the-envelope estimates useful?

Rough calculations of traffic, storage and bandwidth show where the bottlenecks will be, which components need scaling and whether a simpler design is good enough, before you spend money building it.

Do startups need to think about system design?

Yes, but proportionately. A simple, well-structured monolith with a managed database, backups, monitoring and a clear path to scale is usually the right system design for an early-stage product.

Get Expert Help with System Design

We design and build scalable web platforms, from MVP architecture to load testing and performance tuning for growing products. Contact us for a system design review before your next stage of growth.

Want this built for you?

Our team offers Website Deploy On Vercel — get a free quote.

View Services