This first lesson has two goals. The first is to introduce you to MercadoFresco, the fictional company that will accompany us throughout the course: you will see its real starting situation, its concrete problems and why it needs the cloud. The second is to understand what cloud computing is and what AWS is, not as a list of service names, but as a different model for buying, operating and growing the infrastructure of an application.
It is important to start here because almost all of the technical decisions you will make in AWS (which service to use, in which region, at what size, how much it is going to cost) only make sense if you understand the economic and responsibility model that sits underneath. Many teams migrate to the cloud and end up with an enormous bill and a fragile architecture precisely because they skipped this part.
Contents
- MercadoFresco: the company and its single server
- MercadoFresco's four concrete problems
- What cloud computing is
- Your own server versus the cloud: CapEx, OpEx, elasticity and provisioning
- Service models: IaaS, PaaS and SaaS
- Deployment models: public, private and hybrid
- What AWS is: history, scale and service families
- The shared responsibility model
- Pay-as-you-go pricing and the Free Tier
- MercadoFresco's target architecture
MercadoFresco: the company and its single server
MercadoFresco is a Spanish online fresh-produce shop: fruit, vegetables, fish and meat bought
from local suppliers, with home delivery within 24 hours. It started as a small project in a single
city and today serves several thousand orders a month. Its domain is
mercadofresco.example.
The technical team is tiny:
| Person | Role | What keeps them up at night |
|---|---|---|
| Marta | Technical lead | Keeping the site up, the backups and the bill |
| Luis | Developer | Deploying changes without fear and no longer firefighting |
| Sara | Business analyst | Knowing what sells, what breaks and what each order costs |
The whole platform lives today on a single physical server in a cupboard at the office:
flowchart TB
C[Web and mobile customers] --> R[Office router]
R --> S
subgraph S["Single server at the office"]
A["PHP monolith + Python scripts"]
D[("Relational database")]
F["/var/www/fotos - product photos on local disk"]
end
S --- B["USB disk - manual copy whenever someone remembers"]
That single server hosts:
- The monolith: a PHP application that serves the shop and the admin panel, plus several Python scripts that generate the delivery routes and Sara's reports.
- The relational database with customers, products, stock and orders.
- The product photos stored directly on the local disk, in
/var/www/fotos.
There is no test environment: Luis tests on his laptop and deploys by FTP to the very same server that customers use.
MercadoFresco's four concrete problems
We are not going to migrate to the cloud "because it is modern". We are going to migrate because there are four measurable problems that the single server cannot solve.
- It goes down on Friday afternoons
The order peak is concentrated between 17:00 and 21:00 on Friday, when people organise the weekend shop. In that window the traffic is between 8 and 10 times that of a Tuesday morning. The server runs out of memory, the database starts refusing connections and the site returns errors for 20 or 30 minutes. Marta fixes it by restarting services by hand.
The underlying problem: capacity is fixed and sized for the peak. Either you buy an expensive server that runs at 8 % utilisation 90 % of the time, or you buy a cheap one that goes down at the very moment when most of the money comes in.
- There are no reliable backups
There is a USB disk plugged into the server and a cron script that takes a dump of the database
overnight. Nobody has ever tried to restore that dump. The product photos are not copied
anywhere at all. A fire, a burglary or a disk failure at the office would wipe out the entire
catalogue.
- It cannot grow to more cities
Opening in a second and a third city means a bigger catalogue, more simultaneous orders and more delivery routes to calculate. With the current architecture, growing means buying hardware, waiting weeks for it to arrive, racking it and migrating over an entire night. And all of that would fall on Marta, who is one single person.
- Every deployment is a risk
With no test environment and no way to roll back, every change Luis makes can take the shop down. The team deploys on Tuesday mornings "just in case" and avoids touching anything all week.
Keep these four problems in mind: every module of the course solves one or more of them, and by the end we will have built a platform where none of the four exists.
What cloud computing is
Cloud computing is the delivery of information technology resources —servers, storage, databases, networking, software— on demand, over the internet and paid for according to what you actually use.
The key idea is not "the servers are somewhere else". That already existed with traditional hosting. The key idea is three properties combined:
- On-demand self-service: you ask for a server with an API call and you have it in seconds, without talking to a salesperson or signing anything.
- Elasticity: you can have 2 servers on Tuesday and 20 on Friday at 18:00, and be back to 2 at 22:00, paying only for the hours you had them.
- Pay per consumption: you do not buy the asset, you rent its metered use (CPU hours, gigabytes stored, requests served).
A useful analogy: it is the difference between buying an electricity generator and plugging into the grid. The generator is yours, you maintain it, you size it for your peak and it ends up either too small or too big. The grid is always there, you flip the switch, and you pay the kilowatts you use.
Your own server versus the cloud: CapEx, OpEx, elasticity and provisioning
Two financial concepts worth having clear, because they change how decisions get made:
- CapEx (Capital Expenditure): you buy an asset up front. MercadoFresco's server cost €6,000 in one go and is depreciated over 4 or 5 years. It is a hard decision to reverse: if you get the size wrong, you have already paid for it.
- OpEx (Operational Expenditure): you pay for use, month by month, like electricity or the phone bill. If you stop using it, you stop paying for it. It is a reversible decision.
The cloud turns CapEx into OpEx. This has an enormous practical consequence: the cost of being wrong drops dramatically, and therefore you can experiment. Trying a different database no longer means buying a machine; it means starting it up, measuring it for three days and switching it off.
| Aspect | Own server (MercadoFresco today) | Cloud (AWS) |
|---|---|---|
| Spending model | CapEx: €6,000 up front + maintenance | OpEx: monthly bill for actual consumption |
| Provisioning time | Weeks (purchase, shipping, racking, installation) | Seconds or minutes, via API or console |
| Sizing | For the peak; under-used the rest of the time | Matched to demand at every moment |
| Elasticity | None; scaling = buying hardware | Automatic: it grows and shrinks on its own |
| Backups | Home-made script, USB disk, never tested | Managed services with retention and tested restores |
| Fault tolerance | One disk failure = shop down | Replicas across several data centres |
| Geographic reach | One office in one city | Dozens of regions around the world |
| Who maintains the hardware | Marta, at the weekend | AWS |
| Cost of being wrong | High and irreversible | Low: switch the resource off and stop paying |
| Physical security | A locked cupboard at the office | Certified data centres with access control |
An honest caveat, because this course is not a sales brochure: the cloud is not always cheaper. A constant, predictable, well-sized workload running for five years can work out more economical on your own hardware. The cloud wins when there is variability, when you need speed of change, or when the team is small and cannot spend its time maintaining metal, which is exactly the case of MercadoFresco.
Service models: IaaS, PaaS and SaaS
Cloud services are classified by how much you manage and how much the provider manages.
flowchart LR
subgraph OnPrem["On-premises"]
direction TB
O1["You: everything"]
end
subgraph IaaS["IaaS"]
direction TB
I1["AWS: hardware, network, virtualisation"]
I2["You: OS, runtime, app, data"]
end
subgraph PaaS["PaaS"]
direction TB
P1["AWS: + OS, runtime, scaling"]
P2["You: app and data"]
end
subgraph SaaS["SaaS"]
direction TB
S1["AWS/provider: everything"]
S2["You: only your data and users"]
end
| Model | What it gives you | What you still manage | Examples in AWS |
|---|---|---|---|
| IaaS (infrastructure as a service) | Virtual machines, disks, networks | Operating system, patches, runtime, application, data | Amazon EC2, EBS, VPC |
| PaaS (platform as a service) | A ready-made platform where you upload your code or your data | Your application and your data | Elastic Beanstalk, RDS, Lambda, Fargate |
| SaaS (software as a service) | A finished application | Only your data, users and configuration | Amazon WorkMail, Amazon Chime, Amazon Connect |
For MercadoFresco this classification is a constant decision guide. A real example we will see: the database.
- If they install it themselves on an EC2 machine (IaaS), Marta is still responsible for patching MySQL, configuring replication and scheduling the backups.
- If they use Amazon RDS (PaaS), AWS takes care of patches, automatic backups and failover, and the team only designs the schema and writes queries.
The practical rule we will use throughout the course: the more managed, the better, unless you have a concrete reason for the opposite. Every piece you manage yourself is time that Marta and Luis are not spending selling fruit.
Deployment models: public, private and hybrid
| Model | Description | When it makes sense |
|---|---|---|
| Public cloud | All the infrastructure comes from a provider (AWS, Azure, Google Cloud) and is shared between customers in an isolated way | Startups, new applications, variable workloads. This is MercadoFresco's case |
| Private cloud | Infrastructure dedicated to a single organisation, in its own data centre or hosted | Strict regulatory requirements, highly specialised hardware, investment already made |
| Hybrid | A combination of both, connected over a private network | Progressive migrations, legacy systems that cannot be moved (an ERP, a mainframe) |
There is also the term multicloud (using AWS and another provider at the same time), common in large companies for commercial leverage or for resilience. For a team of three people it is almost always a bad idea: it multiplies complexity and the knowledge required without adding value.
MercadoFresco is going to public cloud on AWS, with a short hybrid coexistence phase during the migration (the office server will stay switched on for a few weeks until everything is confirmed to be working).
What AWS is: history, scale and service families
Amazon Web Services (AWS) is Amazon's cloud computing platform. It was born out of an internal problem: in the early 2000s, Amazon.com took months to provision infrastructure for each new project, so they built a layer of common services with APIs. In 2006 they decided to sell it to the public.
Milestones worth knowing, because they explain why the catalogue has the shape it has:
| Year | Milestone |
|---|---|
| 2006 | Launch of Amazon S3 (object storage) and Amazon EC2 (virtual machines) |
| 2009 | Amazon RDS: managed relational databases |
| 2012 | Amazon DynamoDB: NoSQL database at scale |
| 2014 | AWS Lambda: running code with no servers (serverless) |
| 2017 | Managed containers: Fargate, EKS |
| Today | More than 200 services and dozens of regions around the world |
Notice the order: first raw storage and raw compute (IaaS), then managed services (PaaS), then abstractions with no servers at all. That same order is, more or less, the one this course follows.
Scale: AWS operates dozens of geographic regions, each one with several independent data centres, and a private fibre network of its own that connects them. It is the cloud provider with the largest market share and its catalogue exceeds 200 services. You do not need to know them all: with about 25 well understood you can build practically any application.
Service families and what we will see in the course
| Family | What it is for | Services we will see | Module |
|---|---|---|---|
| Compute | Running code and applications | EC2, Lambda, ECS, Fargate, EKS, Elastic Beanstalk | 2, 9, 10 |
| Storage | Keeping files, disks and backups | S3, EBS, EFS | 2 |
| Databases | Keeping structured data | RDS, Aurora, DynamoDB, Redshift, ElastiCache | 2, 6 |
| Networking and delivery | Connecting and bringing content closer to the user | VPC, Security Groups, ELB, CloudFront, Route 53 | 3 |
| Security and identity | Who can do what, and encryption | IAM, KMS, Secrets Manager, Shield, WAF | 4 |
| Observability | Seeing what is happening and what happened | CloudWatch, X-Ray, CloudTrail, Config, Trusted Advisor | 5 |
| Integration | Communicating components with each other | SQS, SNS, EventBridge, Step Functions | 7 |
| Development and deployment | Building and shipping versions | CodeCommit, CodeBuild, CodeDeploy, CodePipeline | 8 |
| Infrastructure as code | Defining infrastructure in files | CloudFormation, CDK, Organizations | 9 |
| Costs and best practices | Controlling spend and quality | Well-Architected, Cost Explorer, Budgets, Savings Plans | 11 |
| Artificial intelligence | Models and data (out of scope for this course) | SageMaker, Bedrock, Rekognition | — |
The shared responsibility model
This is probably the most important concept in the lesson, and the one that causes the most misunderstandings. AWS is not responsible for the whole of your security. It is split in two:
- AWS is responsible for the security of the cloud: the data centres, the hardware, the physical network, the hypervisor and the software of the managed services.
- You are responsible for the security in the cloud: your data, who accesses it, the encryption you enable, the configuration of your networks, the patches on your operating systems and your application code.
flowchart TB
subgraph CLIENTE["YOUR RESPONSIBILITY: security IN the cloud"]
C1["Your data: classification and encryption"]
C2["Identity and permission management - IAM"]
C3["Network and firewall configuration - security groups"]
C4["Operating system, patches and application"]
end
subgraph AWSR["AWS RESPONSIBILITY: security OF the cloud"]
A1["Software of the managed services"]
A2["Global network, regions and Availability Zones"]
A3["Hardware, hypervisor and physical facilities"]
end
CLIENTE --> AWSR
The boundary moves depending on the service you use, and this is key:
| If you use... | AWS takes care of... | You take care of... |
|---|---|---|
| EC2 (IaaS) | Hardware, hypervisor, physical network | OS, patches, firewall, encryption, application, data |
| RDS (managed) | All of the above + OS + engine patches + backups | Schema, DB users, permissions, encryption, queries |
| S3 / Lambda (serverless) | Practically the whole infrastructure | Access permissions, encryption, and your code or your objects |
Almost every security incident that reaches the press as an "AWS leak" is in fact a customer mistake: an S3 bucket left open to the public by configuration, an access key pushed to GitHub, a security group with the database port exposed to the internet. None of those three is AWS's responsibility. We will explicitly avoid all three in this course.
Pay-as-you-go pricing and the Free Tier
The general principle is simple: you pay for what you consume, with no minimum commitment. The three dimensions that are almost always billed are:
- Compute: per second or hour that a machine is switched on.
- Storage: per gigabyte and month that you keep data.
- Data transfer: per gigabyte that leaves AWS towards the internet. Inbound traffic (ingress) is normally free; outbound (egress) is not.
On top of that base there are commitment discounts (Savings Plans, reserved instances, module 11) and cheaper options in exchange for fewer guarantees (spot instances).
A realistic sense of orders of magnitude, so that you stop seeing prices as a mystery. These are approximate figures for the Ireland region, useful for reasoning, not for budgeting:
| Resource | Billing unit | Approximate order of magnitude |
|---|---|---|
Small EC2 instance (t3.micro, 2 vCPU, 1 GB) |
Per hour switched on | ~$0.01/h → ~$8/month if always on |
Medium EC2 instance (t3.medium, 2 vCPU, 4 GB) |
Per hour switched on | ~$0.05/h → ~$35/month |
| S3 Standard storage | GB stored per month | ~$0.023/GB → 100 GB ≈ $2.3/month |
gp3 EBS disk |
GB provisioned per month | ~$0.09/GB → 100 GB ≈ $9/month (charged even when the machine is off) |
| Small RDS database | Per hour + storage | ~$20-40/month |
| Outbound transfer to the internet | GB leaving | ~$0.09/GB (first GB of the month free) |
| AWS Lambda | Requests + GB-second | One million requests a month: cents |
| Load balancer | Per hour + capacity used | ~$18-25/month just for existing |
Two warnings that will save you money starting today:
- Some resources charge even when you do not use them: a detached EBS disk, an unassociated Elastic IP, a load balancer with no traffic, an old snapshot. They are billed for existing.
- Switching off is not always the same as stopping paying: a stopped EC2 instance is not charged for compute, but its EBS disk keeps billing.
The Free Tier
AWS offers a Free Tier with three modalities that we will look at in detail in lesson 01-02, when we create the account:
- 12 months free from sign-up (for example, 750 hours a month of
t2.micro/t3.micro). - Always free, with no expiry (for example, the first million Lambda requests per month).
- Trials of short duration for specific services.
With the Free Tier you can do practically every exercise in this course at a cost of zero or a few euros, provided you delete the resources when you finish. Whenever an exercise could generate spend, we will warn you and tell you how to remove what you created.
MercadoFresco's target architecture
So that you know where we are heading, this is the approximate destination we will build over the eleven modules. You do not need to understand every box yet; come back to this diagram when you finish each module and you will see the pieces lighting up one by one.
flowchart TB
U["MercadoFresco customers"] --> R53["Route 53 - DNS - module 3"]
R53 --> CF["CloudFront + WAF - photos and static files - modules 3 and 4"]
CF --> S3["S3 - product photos - module 2"]
R53 --> ALB["Application Load Balancer - module 3"]
subgraph VPC["VPC in eu-west-1 - module 3"]
subgraph AZA["Availability Zone A"]
E1["EC2 / container - shop"]
end
subgraph AZB["Availability Zone B"]
E2["EC2 / container - shop"]
end
RDS[("RDS Multi-AZ - orders and catalogue - modules 2 and 6")]
CACHE[("ElastiCache - module 6")]
end
ALB --> E1
ALB --> E2
E1 --> RDS
E2 --> RDS
E1 --> CACHE
E1 --> SQS["SQS - order queue - module 7"]
SQS --> L["Lambda - delivery routes and invoices - modules 2 and 7"]
E1 --> CW["CloudWatch - metrics, logs and alarms - module 5"]
IAC["CloudFormation / CDK - module 9"] -.defines.-> VPC
PIPE["CodePipeline - deployments - module 8"] -.deploys.-> E1
Check how each initial problem gets solved:
| MercadoFresco problem | How it is solved | Where you see it |
|---|---|---|
| Friday outages | Several instances behind a load balancer, with auto scaling | Modules 2 and 3 |
| No reliable backups | RDS with automatic backups and S3 with versioning | Modules 2 and 6 |
| Cannot grow | Infrastructure as code and replicable containers | Modules 9 and 10 |
| Risky deployments | Pipeline with a test environment and rollback | Module 8 |
Common Mistakes and Tips
- Believing that "migrating to the cloud" means copying the server as it is. Spinning up a single EC2 instance with everything inside (the famous badly done lift and shift) reproduces exactly the same problems, but paying more. The cloud adds value when you take advantage of its elasticity and its managed services.
- Ignoring shared responsibility. "It is on AWS, so it is secure" is false. A badly configured S3 bucket is public on the internet in five seconds and the responsibility is yours.
- Forgetting outbound transfer. It is the line on the bill that surprises new teams the most. Serving product photos directly from an instance can cost far more than serving them from S3 with CloudFront.
- Leaving resources on "just in case". Get into the habit today of deleting whatever you create for practice. At the end of each exercise in this course we will remind you how.
- Trying to learn all 200 services. You do not need them. Master the ~25 in the syllabus and you will know how to read the documentation for the rest when you need it.
- Tip: when you hesitate between managing it yourself and using a managed service, ask yourself how much an hour of Marta's time is worth. The managed service almost always wins.
Exercises
Exercise 1: diagnosing MercadoFresco
Without using any AWS service yet, build a table with MercadoFresco's four problems. For each one state: (a) the business impact in one sentence, (b) whether a bigger server of your own would solve it, and (c) which property of the cloud (elasticity, managed services, geographic distribution or pay-as-you-go) attacks the root cause.
Exercise 2: classifying services by model
Classify each of these items as IaaS, PaaS or SaaS, and justify in one line who manages the operating system in each case:
- A Linux virtual machine where you install Nginx and MySQL yourself.
- A MySQL database managed by AWS that you only connect to through an endpoint.
- A corporate mail system that you access through a browser.
- A function that runs Python code when an HTTP request arrives, with no visible server involved.
Exercise 3: monthly cost estimate
Marta proposes a first minimal architecture for MercadoFresco on AWS:
- 2
t3.mediuminstances running 24 hours a day. - 1 small RDS database.
- 1 load balancer.
- 200 GB of photos in S3.
- 300 GB of outbound transfer to the internet per month.
Using the order-of-magnitude table from this lesson, estimate the total monthly cost and say which two line items are the largest. Then propose a change that reduces the cost without making Friday availability worse.
Solutions
Solution 1
| Problem | Business impact | Does a bigger server solve it? | Cloud property that attacks the cause |
|---|---|---|---|
| Friday outages | Orders are lost in the highest-revenue window, and those customers do not come back | Partly, and paying for idle capacity 90 % of the time | Elasticity: capacity that grows and shrinks with demand |
| Unreliable backups | A disk failure can destroy the catalogue, the customers and the order history | No: a big server also has a single disk and a single location | Managed services with automatic backups and geographic distribution |
| Cannot grow to more cities | Blocks the company's commercial expansion | No: each city would need another hardware purchase with weeks of waiting | Provisioning in minutes and pay-as-you-go |
| Risky deployments | Slows product improvement: the team deploys rarely and fearfully | No: it is a problem of process and of missing environments | Self-service: creating an identical test environment takes minutes |
Solution 2
- IaaS. AWS gives you the virtual machine; the operating system, the patches, Nginx and MySQL are managed by you (Amazon EC2).
- PaaS. AWS manages the operating system and the database engine, including backups and patches; you only manage the schema and the data (Amazon RDS).
- SaaS. There is no operating system visible to you; you only configure users and mailboxes (for example, Amazon WorkMail).
- PaaS (in its serverless variant, often called FaaS). There is no operating system for you to administer; you only supply the code (AWS Lambda).
Solution 3
| Line item | Calculation | Approximate cost |
|---|---|---|
2 × t3.medium 24/7 |
2 × $35 | $70 |
| Small RDS | — | $30 |
| Load balancer | — | $20 |
| 200 GB in S3 | 200 × $0.023 | $4.6 |
| 300 GB outbound | 300 × $0.09 | $27 |
| Total | ≈ $152/month |
The two largest line items are EC2 compute ($70) and outbound transfer ($27).
Two possible improvements:
- Serve the photos through CloudFront in front of S3 (module 3): outbound traffic from the cache is cheaper than from the instance and it also takes load off the servers.
- Replace the 2 fixed instances with an auto scaling group with 1 instance as a baseline that grows to 3 or 4 on Friday afternoons (modules 2 and 3): it lowers the average cost and improves availability exactly at the peak.
Note that going from 2 instances down to 1 with no scaling would be cheaper but would worsen availability, so it does not meet the requirement.
Conclusion
You now have the two foundations the rest of the course rests on. On one side, MercadoFresco: a fresh-produce shop trapped on a single server, with Friday outages, backups nobody has ever tested, no way to grow and deployments that are frightening. On the other, the cloud model: on-demand resources, pay-as-you-go, CapEx turned into OpEx, real elasticity and managed services that free up the team's time.
You have also seen the three mental frameworks you will use constantly: IaaS/PaaS/SaaS to decide how much you want to manage, shared responsibility to know which part of security is yours, and the pricing model so that no bill ever surprises you.
In the next lesson, 01-02 "Setting up your AWS account", Marta moves from theory to practice: she creates MercadoFresco's account, protects the root user with MFA, creates the administrator user we will work with for the whole course and sets up the first financial safety net so that the bill never gets out of control.
AWS Course
Module 1: Introduction to AWS
- What Is AWS?
- Setting Up Your AWS Account
- AWS Global Infrastructure
- The AWS Management Console
- AWS CLI and SDKs
Module 2: Core AWS Services
Module 3: Networking and Content Delivery
Module 4: Security and Identity
- AWS Identity and Access Management (IAM)
- AWS Key Management Service (KMS)
- Secrets Manager and Parameter Store
- AWS Shield
- AWS WAF
Module 5: Monitoring and Management
Module 6: Databases
Module 7: Application Integration
- Amazon SQS
- Amazon SNS
- Amazon EventBridge
- AWS Step Functions
- Integration Patterns: Idempotency, Retries and Dead-Letter Queues
