Mark Ku's Blog

Introduction

I've compiled some notes on high-traffic website architecture design. The common theme seems to be "divide and conquer"—breaking down large components into smaller ones. This involves splitting up tasks or bottlenecks to make the system or services easy to scale horizontally, avoiding overload at a single point which can create a system bottleneck. This is actually similar to large organizations in the real world; when they hit a growth bottleneck, they have to restructure.

Frontend

Backend

Database

  • Database performance optimization. For example: creating indexes, optimizing queries, denormalization, reducing joins, vertical table partitioning, or using a caching server to cache data that doesn't change often, avoiding fetching it from the DB every time.
  • The database can be sharded or partitioned into multiple databases to distribute data processing.
  • Read-write splitting - Separate database reads and writes, using Master-Slave Replication to handle a large volume of read requests.
  • Use NoSQL databases. NoSQL is effective for partitioning and sharding, has horizontal scaling capabilities, and is particularly suitable for handling large-scale data, such as user profiles.
  • Ensure transactional consistency using locking mechanisms

Caching

  • Frontend Caching - Enable client-side caching. If a file hasn't changed, the client doesn't need to request it again.
  • Backend Caching - For data that is frequently queried but rarely changes, a caching server can be used, or use a Redis Cluster for data sharding (suitable for scenarios with contiguous Redis keys).

Operations

  • Load Balancer - The core principle of load balancing is to distribute traffic and tasks across multiple servers using a reverse proxy mechanism. If the QPS is less than 10k, it's recommended to use a software reverse proxy (like Nginx or YARP). Hardware load balancers have specially designed chips that can handle much higher traffic loads. When QPS exceeds 10k, you should consider purchasing a hardware load balancer, such as an F5.
  • Adopt a modern system operations architecture (K8s) to scale out and in based on QPS or system resources.
  • Service Monitoring (Health Check) - Promptly detect and respond to service anomalies to ensure stable operation. For example: Uptime-Kuma
  • Application Observability - Provides visualization and analysis of application performance, facilitating problem diagnosis and performance optimization. For example: Signoz, Prometheus
  • Log Server - Centralizes log management and analysis, making it easier to find and trace the source of issues. For example: Grafana, SEQ

Security

Finally

To be honest, there are some features here that I haven't implemented myself, but I've compiled this list to give myself a conceptual map. This way, when I encounter these problems, I'll at least have a starting point for a solution. However, not every website needs this kind of architecture. A design that is too granular can increase maintenance costs. Instead, it's more appropriate to consider future business volume when evaluating this type of website architecture.

References

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··602

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··490

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··333

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··264

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··221

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··215

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11
淺談高併發的網站架構設計 - Mark Ku's Tech Notes