SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
  • Client-Server
  • Monolithic Architecture
  • Microservices
  • Serverless
  • Event-Driven Architecture
  • Peer-to-Peer (P2P)
  • Hexagonal Architecture
  • CQRS
  • Event Sourcing
  • Domain-Driven Design (DDD)
  • Layered (N-Tier) Architecture
  • Containers and Docker
  • Kubernetes Basics
  • Clean Architecture and Modular Monolith
  • Multi-Tenancy
  • Cloud Basics: Regions, Zones and Edge
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Architecture/Architectural Patterns

Cloud Basics: Regions, Zones and Edge

Where cloud machines live (regions and availability zones), and why some work runs near the user at the edge.

⏱ 13 min readBeginnerMust KnowInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

The cloud means renting computers, storage and software over the internet, on demand, and paying only for what you use. Cloud providers place these machines in regions and availability zones.

  • A region is a part of the world with several data centres (for example "Western Europe").
  • An availability zone (AZ) is one or more separate data centres inside a region, with their own power, cooling and network.
  • Edge computing runs code or keeps data at many small locations close to users, so answers arrive faster.

02Concept: What is it?

Years ago, a company bought its own servers, put them in a room and hired people to look after them. In the cloud, a provider owns huge data centres and rents you a slice. You can ask for ten servers in the morning and give them back at night. This is elastic: you grow and shrink as needed, and you pay for use.

Cloud providers organise their data centres in layers. A region is a geographic area. Inside a region there are several availability zones. Each zone is built to fail on its own: separate power, cooling and network links. Zones in one region are connected by fast links, so they are only a few milliseconds apart (an illustrative figure). Regions can be thousands of kilometres apart, so the trip between them takes tens or hundreds of milliseconds.

Regions, zones and the edge
Region A
🏢Zone A1
🏢Zone A2
🏢Zone A3
↔far apart
Region B
🏢Zone B1
🏢Zone B2
🏢Zone B3
📡Edgenear users
📡Edgenear users
📡Edgenear users
📡Edgenear users
Each region has several zones. Edge locations are many small sites close to users.
🧠Zone failure and region failure are different
Spreading across zones protects you from one data centre failing. To survive a whole region failing (rare, but it happens), you need servers in a second region too.

03Real-Life Example

🍵A Pizza Chain With Kitchens and Delivery Points
A pizza company has big kitchens in a few cities (regions). Each city has three kitchens in different streets, with their own ovens and electricity (zones), so one power cut closes only one kitchen. Customers far from the kitchens would wait too long, so the company also opens small pick-up points on many street corners (edge). A pick-up point can hand over pizzas that were already made (cached content), but it cannot cook something new and complicated. For that, the order goes back to a kitchen.
Pizza company
Cloud
A city with kitchens
A region
One kitchen in its own street
An availability zone
Each kitchen has its own power and ovens
Separate power, cooling and network per zone
A pick-up point on a street corner
An edge location
Handing over ready pizzas
Serving cached files from the edge
Cooking a new custom pizza
Running dynamic work in a region
Renting a kitchen by the hour
Pay as you go
Where a request goes
👤User
→↓close
📡Edgecached files
⇢⇣only if needed
🏢Regiondynamic work

04Why Do We Need It?

💸Pay for what you use
No big purchase up front. Turn machines off when you do not need them.
📈Elastic growth
Add servers for a busy day and remove them after. No need to guess a year ahead.
🛡️Survive failures
Spread over zones and regions, so one broken building does not stop the service.
🌍Be close to users
Pick regions near your customers and use the edge to cut the trip.
⚖️Follow the law
Some data must stay in a country or area. The region you choose decides where it lives.
🧰Managed services
Let the provider run databases, queues and more, so your team builds features.
The cloud gives you rented, elastic machines in many places. Where you put them decides how fast and how safe your system is.

05Where Do We Use It?

🛒Web shops
Servers in several zones, a database copied across zones, and a CDN at the edge for images.
🎬Streaming
Popular videos are stored close to viewers, at the edge. Rare ones come from a region.
🏦Banks and health
Data kept in a chosen region for legal reasons, with a second region for disaster recovery.
🏭Factories and IoT
Small computers at the site (edge) react in milliseconds and send summaries to the cloud.
🎮Online games
Game servers in many regions, so players connect to one nearby and feel less lag.
🤖Machine learning
Rent big, costly machines only for training time, then release them.

06Types / Parts / How It Works

Ways to rent: IaaS, PaaS, SaaS

ModelYou manageProvider managesExample idea
IaaS (infrastructure)Operating system, runtime, app, dataMachines, storage, networkVirtual machines, block storage
PaaS (platform)Your app and dataOS, runtime, scalingA service that runs your code for you
FaaS (functions)Only a functionEverything else, including scaling to zeroSee Serverless
SaaS (software)Your settings and your dataThe whole applicationEmail, chat or a CRM tool

Where to put your servers

Four common deployments
One zone
🏢Zone 1
A single point of failure
Many zones
🏢Z1
🏢Z2
🏢Z3
Survives a zone failure
Two regions, one active
🌐Active
🌐Standby
Survives a region failure, after a pause
Two regions, both active
🌐Active
🌐Active
Fast for both, costs the most
Each step up survives bigger failures, and costs more and adds complexity.

What the edge can and cannot do

Edge useWhat happensLimit
CDN cacheStatic files served from a nearby siteOnly content that can be cached
Edge functionsSmall pieces of code run near the user (redirects, headers, A/B choices)Short, small programs with little memory
IoT gatewayA box at a factory or shop reads sensors and reacts locallyNeeds updates and care at every site
5G / telecom edgeCompute inside the mobile network for very low delayFewer sites and special services
VisualizerSurvive a failure: zones, regions and the edgePick a deployment, then fail one zone and then the whole region. Watch who stays up, how far users must travel, and what the edge saves.
How is the app deployed?
What fails?
Edge locations
Region A (home)
🏢Zone A1serving
🏢Zone A2serving
🏢Zone A3serving
Region B (far away)
🏢Zone B1no servers
🏢Zone B2no servers
🏢Zone B3no servers
Relative cost
3
illustrative units
Users near region A
20 ms
served from region A
Users near region B
150 ms
served from region A
Servers are spread over three zones in one region. Users near region B are far from it, so they see the longer trip.

An illustrative model: 20 ms on the same continent, 150 ms across continents, 10 ms to the edge. Cost counts 1 per active zone and 0.5 per standby zone. Real numbers depend on the provider, the regions and the prices.

07How to Use It / Steps / Implementation

Choosing where to run

  1. 1
    Start with the rules
    Does the law or a customer contract say where data must live? That can decide the region before anything else.
  2. 2
    Pick regions near your users
    Fewer kilometres means less delay. Use the Numbers Every Engineer Should Know to see how much a trip across the ocean costs.
  3. 3
    Use at least two or three zones
    Put servers and replicas in different zones. This is the cheap and common way to survive a data-centre failure.
  4. 4
    Decide if you need a second region
    Match it to your availability target. Many systems accept a short outage and use backups. Others pay for active-active.
  5. 5
    Keep spare capacity
    If one zone fails, the other two take its load. Plan so they can hold it (about 50% more each with three zones).
  6. 6
    Push cacheable content to the edge
    Images, scripts and public pages can come from a CDN. Keep dynamic work in a region.
  7. 7
    Watch the bill
    Moving data out of a region or between regions often costs money. Compare on-demand, reserved and spot options for your workload.
⚠️Shared responsibility
The provider secures the building, the hardware and the base services. You secure what you put in the cloud: access rules, your data, your settings. Many leaks come from a wrongly opened storage bucket, not from the provider.
💡Test the failure
A design that has never been tested may not survive. Practise losing a zone on purpose, and check that traffic moves and nothing important breaks.

08Key Terms to Know

TermMeaning in easy words
CloudComputing resources rented over the internet, on demand, with pay-for-use pricing
RegionA geographic area where a provider has a group of data centres
Availability zone (AZ)A separate data centre (or group) inside a region with its own power, cooling and network
ElasticityGrowing and shrinking resources to match demand
IaaS / PaaS / SaaSRenting machines, a platform to run code, or a finished application
Edge computingRunning code or caching data at many places close to users or devices
Edge locationA small site near users that serves cached content or runs light code
Data residencyA rule that data must stay in a certain country or area
Shared responsibility modelThe provider secures the cloud itself, and you secure what you build on it
Egress feeA charge for moving data out of a cloud or between regions
Vendor lock-inBeing so tied to one provider's special services that leaving is hard and costly

09Pros, Cons and Trade-offs

✅ Pros
  • No big upfront cost, and pay for use
  • Grow and shrink quickly
  • Many zones and regions to survive failures
  • Edge locations put content near users
  • Managed services remove a lot of work
⚠️ Cons
  • Costs can grow quietly (data transfer, idle machines)
  • Multi-region designs are complex
  • Lock-in to one provider's services
  • You still own security of your setup
  • Edge code has small limits and is harder to debug

Trade-offs

ChoiceWe gainWe lose
One zoneCheapest and simplestAny zone problem is an outage
Many zones, one regionSurvive a data-centre failure with fast links between zonesA whole-region outage still stops you
Two regions, passiveSurvive a region failureA pause while switching, and you pay for idle capacity
Two regions, active-activeFast for users in both areas and no big pauseHighest cost, data copied across regions, conflicts to manage
More edgeLower delay for cacheable contentStale data, harder deployments, small runtimes
Managed servicesLess work for your teamLess control and more lock-in

10Common Problems and Mistakes

Common mistakes

  1. Everything in one zone. It is easy to start this way and forget to change.
  2. Thinking zones protect against a region failure. They do not. All the zones are inside the region.
  3. No spare capacity. After a zone fails, the survivors need room to take its traffic.
  4. Forgetting data transfer costs. Chatty services across zones or regions can add a large bill.
  5. A second region that was never tested. The standby may be out of date or missing a setting.
  6. Public storage by mistake. A misconfigured bucket exposes data. This is the customer's part of the shared responsibility.
  7. Putting dynamic, personal data at the edge without a plan. Caches can show one user's page to another.

Things to watch

🌪️Region-wide outage
Rare but real. Decide ahead whether you accept it, or pay for a second region.
🔌Hidden shared dependency
Two regions that both rely on one global service share its failure.
🧾Bill surprises
Idle machines, large transfers and logs add up. Set budgets and alerts.
🕸️Data copies and delay
Copying data across regions is slow and can leave the copies different for a moment.

11Real-World Examples

☁️The big providers
Amazon Web Services, Microsoft Azure and Google Cloud all organise their machines into regions and zones. Names and counts change, so check their current pages.
📡CDNs and edge platforms
Many CDNs run small programs at their edge sites, near the user, as well as caching files.
🎥Video services
Popular titles are placed at the edge. The rest are served from storage in a region.
🏥Regulated data
Hospitals and banks often pick a region by law, and add a second region for recovery.
🏭Industrial IoT
Local gateways react at once, and send summaries to the cloud when the link is up.
🧪Chaos testing
Some teams switch off a zone on purpose, to prove the system survives.
📝Note
Which services exist, where, and how much they cost changes often. Treat the numbers on this page as illustrative, and check the provider's documents before you design.
Mini case: a shop in two regions
👥Usersworldwide
→↓nearest
📡Edge + global routing
→↓to a region
🏢Region A and B3 zones each
↔copy data
🗄️Replicated database
Edge and routing Regions Data
Users go to the nearest region. If one region fails, the other takes over.

12Related Topics to Read Next

Global Load Balancing→

Sends users to the best region and moves away from a failed one.

Fault Tolerance and Redundancy→

The idea behind spreading across zones and regions.

Failover→

How traffic moves to the standby when a zone or region fails.

CDN→

The best-known use of edge locations.

Serverless→

A cloud model where you only write functions.

Replication Models→

How data is copied between zones and regions.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔Cloud: rented, elastic computing. Pay for use.
  • ✔Region: a geographic area. Zone: a separate data centre inside it.
  • ✔Zones: survive one data centre failing. Regions: survive a whole region failing.
  • ✔Plan spare room: survivors must carry the failed zone's load.
  • ✔Edge: code and cache near users. Great for static content, limited for dynamic work.
  • ✔IaaS / PaaS / SaaS: the more the provider manages, the less control you have.
  • ✔You secure: your data, access and settings (shared responsibility).
  • ✔One line: “Put your servers in several zones, add regions only if you must, and use the edge for what can be cached.”
← Previous
Multi-Tenancy
Next →
Service Discovery