1 · Entry
DNS maps the domain to the public endpoint. A CDN moves static content closer to the client.
Interactive diagram · architecture
DNS maps the domain to the public endpoint. A CDN moves static content closer to the client.
A load balancer distributes traffic across web servers so the web tier can scale horizontally.
Read requests use memory first, then SQL read replicas, reducing load on the write master.
A queue decouples slow jobs from the request path. A worker pulls and completes them later.
SQL replication, object storage, sharding, and federation help the data tier grow.
Another queue and worker service add capacity for background jobs.
The user or program making a read or write request.
It resolves the service name with DNS or requests static content from the CDN. Dynamic traffic goes to the Load Balancer.
The service must secure incoming HTTP, HTTPS, and SSH access.
DNS maps a domain to a public IP address.
It receives the client lookup and directs the client to the public endpoint. The client can then reach the CDN or Load Balancer.
DNS lets a domain point to a new IP for failover.
A content delivery network serves static and some dynamic content closer to users.
It receives static requests from the Client and serves files from Object Store. This reduces load and latency for the Web Server.
Static content moved to a CDN increases system complexity.
A component that distributes incoming traffic across servers.
It receives client traffic and hands requests to Web Server instances. It can terminate SSL before traffic reaches the servers.
Horizontal scaling adds components and operational complexity.
The public compute tier that receives and processes requests.
It receives work from the Load Balancer. It reads through Memory Cache, sends writes to the SQL Write Master–Slave, or adds background jobs to Queue.
Vertical scaling can become expensive and has no redundancy or failover.
Step 4 · Run work asynchronously
A worker that runs jobs outside the request path.
It pulls a job from Queue and creates a thumbnail or updates a Database. It can then store the thumbnail in Object Store.
Queues add delays and complexity.
Step 4 · Run work asynchronously
A queue holds jobs until a worker can process them.
Web Server adds background work here. Worker Service pulls the next job and hands results to NoSQL or Object Store.
Queues add delays and complexity.
Another worker that runs jobs outside the request path.
It pulls jobs from the second Queue. It increases asynchronous processing capacity with the first Worker Service.
Queues add delays and complexity.
Another queue that holds background jobs.
It accepts work and hands the next job to the second Worker Service. It lets the asynchronous layer scale independently.
Queues add delays and complexity.
Step 4 · Run work asynchronously
A database used for appropriate data outside the relational store.
Worker Service can update this database after pulling a Queue job. It holds data that does not need the SQL write path.
Choose SQL or NoSQL based on the data and access needs.
Step 3 · Serve read-heavy traffic
An in-memory store for frequently accessed content and session data.
Web Server checks it first for reads. On a miss, the request continues to SQL Read Replicas.
Try the MySQL cache before adding a memory cache.
The relational database that accepts writes and replicates them to slaves.
Web Server sends writes here. Changes replicate to SQL Read Replicas for read traffic.
One write master can become a bottleneck as writes increase.
Step 3 · Serve read-heavy traffic
Replica databases that serve reads after the write master copies changes.
Memory Cache misses reach these replicas. They reduce read load on SQL Write Master–Slave.
Read replicas add data-copying and routing work.
Storage for static files separate from the web server.
CDN serves files from it. Web Server and Worker Service can store user files and thumbnails here.
Separate storage requires Web Server changes and adds complexity.
A pattern that splits one data set across databases.
Customers A–M and Customers N–Z hold different ranges. The application selects the right shard for each operation.
Sharding is an additional SQL scaling pattern to consider as data grows.
A pattern that splits databases by function.
Customers SQL and Products SQL keep different functions separate. The application selects the database for the operation.
Federation is an additional SQL scaling pattern to consider as data grows.
Detail · follows playback, or click any box or step to pin it
Close · follow playbackClick any box for an explanation, or use Next or Play to walk through the six steps.
DNS maps the domain and a CDN can serve static content.
The client reaches a public endpoint before it sends a request.
A load balancer distributes traffic across Web Server instances.
The web tier can then scale horizontally and avoid a single point of failure.
Memory Cache handles frequent reads before SQL Read Replicas.
This lowers pressure on the SQL write master.
Queue holds background work until Worker Service can process it.
This separates slow jobs, such as thumbnail creation, from the request path.
SQL replication, Object Store, sharding, and federation support the growing data tier.
The data architecture evolves as storage, reads, and writes become bottlenecks.
A second queue and worker service increase background-job capacity.
Long-running work can scale separately from request processing.