惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
K
Kaspersky official blog
V
Vulnerabilities – Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Secure Thoughts
I
Intezer
TaoSecurity Blog
TaoSecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Spread Privacy
Spread Privacy
A
About on SuperTechFans
NISL@THU
NISL@THU
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
S
SegmentFault 最新的问题
G
Google Developers Blog
B
Blog
N
News and Events Feed by Topic
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
V
Visual Studio Blog
MyScale Blog
MyScale Blog
Webroot Blog
Webroot Blog
Vercel News
Vercel News
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
S
Security Affairs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
博客园 - 叶小钗
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Know Your Adversary
Know Your Adversary
T
Tailwind CSS Blog
F
Fortinet All Blogs
D
DataBreaches.Net
博客园 - Franky
博客园_首页
H
Heimdal Security Blog
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
Attack and Defense Labs
Attack and Defense Labs
Project Zero
Project Zero
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
HLD Fundamentals #4: How Systems Scale: From 0 to 100 Million Users
Jaspreet singh · 2026-06-18 · via DEV Community

One of the most common system design interview questions is:

"How would you scale a web application from 100 users to 100 million users?"

The answer is rarely a single technology. Instead, systems evolve through multiple stages, with each stage solving a specific bottleneck.

This article walks through the typical evolution of a scalable system and explains why, how, and when each component is introduced.


1. Single Server

Why Start Here?

Every application starts simple.

In the beginning:

  • Traffic is low
  • Development speed matters more than scalability
  • Infrastructure costs should be minimal

What Is It?

A single machine handles everything:

  • Frontend
  • Backend
  • Database
Users
   |
   v
Single Server
├── Application
└── Database


How Does It Work?

  1. User sends request.
  2. Application processes request.
  3. Database stores and retrieves data.
  4. Response is returned.

Everything happens on one machine.


Problem

As traffic grows:

  • CPU becomes overloaded
  • Memory becomes insufficient
  • Database competes with application for resources

A single server becomes a bottleneck.


Interview One-Liner

A single server architecture is simple and cost-effective but becomes a bottleneck as traffic and resource usage increase.


2. Application and Database Separation

Why Do We Need It?

The application and database have different workloads.

Application Server:

  • Uses CPU
  • Handles business logic

Database Server:

  • Uses memory and storage
  • Handles queries

Keeping them together causes resource contention.


How Does It Work?

Move the database to a separate machine.

Users
   |
   v
Application Server
   |
   v
Database Server


Benefits

  • Independent scaling
  • Better resource utilization
  • Improved performance

Example

Suppose an e-commerce website receives thousands of requests.

The application handles:

  • Authentication
  • Order processing
  • API responses

The database handles:

  • Product data
  • Orders
  • User information

Separating them prevents one workload from affecting the other.


Interview One-Liner

Separating the application and database allows each layer to scale independently and removes resource contention.


3. Load Balancer and Multiple Application Servers

Why Do We Need It?

Eventually one application server is not enough.

Problems:

  • High CPU utilization
  • Increased response time
  • Single point of failure

What Is a Load Balancer?

A load balancer distributes incoming traffic across multiple servers.

Instead of sending all traffic to one machine, requests are spread evenly.


How Does It Work?

              Users
                 |
                 v
          Load Balancer
            /       \
           /         \
          v           v
      App Server   App Server


Request Flow

  1. User sends request.
  2. Load balancer receives request.
  3. Load balancer selects a healthy server.
  4. Request gets processed.

Benefits

Scalability

Add more servers when traffic increases.

High Availability

If one server fails, traffic is routed elsewhere.

Better Performance

Traffic is distributed evenly.


Interview Follow-Up

Common Algorithms

  • Round Robin
  • Least Connections
  • IP Hashing

Interview One-Liner

A load balancer distributes traffic across multiple application servers, improving scalability, performance, and availability.


4. Database Replication

Why Do We Need It?

Even after scaling application servers, the database often becomes the next bottleneck.

Most systems have:

Reads >> Writes

For example:

  • Product browsing
  • Social media feeds
  • News websites

Users perform far more reads than writes.


What Is Database Replication?

Replication creates copies of the database.

                Primary DB
                     |
         ------------------------
         |                      |
         v                      v
     Replica DB           Replica DB


How Does It Work?

Primary Database

Handles:

  • INSERT
  • UPDATE
  • DELETE

Replica Databases

Handle:

  • SELECT queries

Data is copied from primary to replicas.


Example

Amazon Product Page:

Every user viewing products performs reads.

Only a few users are updating inventory.

Reads are served by replicas.

Writes go to primary.


Benefits

  • Increased read capacity
  • Better performance
  • Improved availability

Challenges

Replication Lag

Replica may be slightly behind primary.

This leads to eventual consistency.


Interview One-Liner

Database replication scales read traffic by creating read-only replicas while keeping writes on the primary database.


5. Cache Integration

Why Do We Need It?

Even replicated databases can become overloaded.

Many requests ask for the same data repeatedly.

Examples:

  • Trending products
  • User profiles
  • Popular posts

Reading from the database every time is expensive.


What Is a Cache?

A cache is a fast in-memory storage layer.

Popular examples:

  • Redis
  • Memcached

How Does It Work?

User
  |
  v
Application
  |
  v
Cache
  |
  |
 Hit? ---- Yes ----> Return Data
  |
 No
  |
  v
Database


Cache Hit

Data found in cache.

Response is very fast.

Cache Miss

Data not found.

Application fetches from database and stores it in cache.


Example

Instagram Profile Page

Instead of querying the database millions of times, frequently accessed profiles are served directly from Redis.


Benefits

  • Lower database load
  • Faster response times
  • Better user experience

Interview One-Liner

A cache stores frequently accessed data in memory to reduce database load and improve response time.


6. CDN (Content Delivery Network)

Why Do We Need It?

Not all content is dynamic.

Static content includes:

  • Images
  • CSS
  • JavaScript
  • Videos

Serving these files from the application server is inefficient.


What Is a CDN?

A CDN is a geographically distributed network of servers that stores cached copies of static content closer to users.


How Does It Work?

User (India)
      |
      v
Nearest CDN Edge
      |
      v
Origin Server

The CDN serves content from the nearest location.


Example

Netflix

Movie assets are stored across multiple CDN edge locations worldwide.

Users download content from nearby servers rather than a central location.


Benefits

  • Reduced latency
  • Faster content delivery
  • Reduced load on origin servers

Interview One-Liner

A CDN stores static content closer to users globally, reducing latency and improving performance.


7. Data Center Scaling

Why Do We Need It?

What happens if an entire region goes down?

Examples:

  • Power failure
  • Network outage
  • Natural disasters

A single data center becomes a major risk.


How Does It Work?

Deploy infrastructure across multiple regions.

           Global Load Balancer
                 /      \
                /        \
               v          v
      Data Center A   Data Center B


Benefits

High Availability

If one region fails, another takes over.

Disaster Recovery

Business continues operating.

Lower Latency

Users connect to the nearest region.


Interview One-Liner

Multiple data centers improve fault tolerance, disaster recovery, and global availability.


8. Message Queues

Why Do We Need It?

Some tasks do not need immediate execution.

Examples:

  • Sending emails
  • Processing payments
  • Generating reports
  • Image resizing

Doing these tasks synchronously increases response time.


What Is a Message Queue?

A message queue allows services to communicate asynchronously.

Popular technologies:

  • RabbitMQ
  • Apache Kafka
  • Amazon SQS

How Does It Work?

User Request
      |
      v
Application
      |
      v
Message Queue
      |
      v
Worker Service


Flow

  1. Application places message in queue.
  2. User receives immediate response.
  3. Worker processes task later.

Example

Order Placement

Without Queue:

Create Order
Send Email
Generate Invoice
Update Analytics
Return Response

With Queue:

Create Order
Return Response

Background Workers:
- Send Email
- Generate Invoice
- Update Analytics


Benefits

  • Faster responses
  • Better scalability
  • Loose coupling

Interview One-Liner

Message queues enable asynchronous communication and help handle background processing efficiently.


9. Database Sharding

Why Do We Need It?

Eventually one database server cannot store or process all data.

Problems:

  • Massive table sizes
  • Slow queries
  • Storage limitations

Vertical scaling reaches its limit.


What Is Sharding?

Sharding splits data across multiple databases.

Each database stores only a subset of the data.


How Does It Work?

User-Based Sharding

Shard 1 → Users 1 - 1M

Shard 2 → Users 1M - 2M

Shard 3 → Users 2M - 3M


Request Flow

Application
     |
     v
Shard Router
     |
-------------------
|        |        |
v        v        v
DB1     DB2      DB3

The router determines where data belongs.


Example

Instagram

A single database cannot store billions of users efficiently.

Users are distributed across multiple shards.


Benefits

  • Horizontal scaling
  • Increased storage capacity
  • Better write throughput

Challenges

Cross-Shard Queries

Joining data across shards becomes difficult.

Rebalancing

Adding new shards requires moving data.


Interview One-Liner

Sharding horizontally partitions data across multiple databases to achieve virtually unlimited scalability.


Quick Revision

Component Why Introduced?
Single Server Simple starting point
App + DB Separation Independent scaling
Load Balancer Distribute traffic
Database Replication Scale reads
Cache Reduce database load
CDN Serve static content faster
Multiple Data Centers High availability
Message Queue Asynchronous processing
Database Sharding Scale massive datasets

The Complete Evolution

Single Server
      ↓
Separate App & Database
      ↓
Load Balancer + Multiple App Servers
      ↓
Database Replication
      ↓
Cache Layer
      ↓
CDN
      ↓
Multiple Data Centers
      ↓
Message Queues
      ↓
Database Sharding

Key Takeaways

  • Systems scale by removing bottlenecks one at a time.
  • Load balancers solve application server bottlenecks.
  • Replication solves read bottlenecks.
  • Caching reduces database pressure.
  • CDNs reduce latency for static content.
  • Message queues enable asynchronous processing.
  • Sharding solves large-scale database growth.
  • There is no single scaling solution; each technique addresses a specific problem.

Understanding the why, how, and trade-offs of each stage is exactly what interviewers look for in system design discussions.