Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Choosing between your own server and the cloud

After this lesson: I can choose between running my own server and a cloud service.

45 min lesson3 commandsDocker basics lab: learn containers, logs and restarts by fixing a broken service

A cake shop before Christmas

A cake shop sells online from a small server in the back room. Most months it copes well. In December ten times as many people visit, and the website slows to a crawl.

The owner could buy a bigger server that sits idle for eleven months. Or she could rent more power for December only. This lesson helps you choose.

By the end of this lesson

Note

I can choose between running my own server and a cloud service.

Key words

WordWhat it meansExample
Cloud servicecomputing you rent from a provider over the internet
IaaSrenting a bare machine that you look after yourself
PaaSrenting a place to run your app, looked after for you
SaaSrenting a finished app that you just useweb email
Scaleadd or remove computing power as the work changes
Running costwhat it costs each month to keep going

The cells students fill in are left blank in this preview.

Before you start

Note

Press Start the lab on the bar at the top. This is the containers lab from the first lesson, with the same three parts. Today you only look at it, to see what running your own server means.

Your own server needs looking after

On your own server, every part is your job. You start it, you watch it, you update it and you fix it at midnight.

The first Run counts the parts of the lab app. The second shows the web server's version, which you would have to keep up to date. The third shows how many processors the machine has. That number is fixed until you buy more.

Count the parts you look after

Command
docker ps -a

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Which version would you update?

Command
docker exec web nginx -v

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

How many processors are there?

Command
docker exec web nproc

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Three ways to rent from the cloud

A cloud provider rents computing to you, and you pay for what you use. How much they look after decides the kind.

With IaaS you rent a bare machine and look after everything on it. With PaaS you hand over your app and they run it. With SaaS you use a finished app, such as web email, and look after nothing but your own data.

Who looks after what

JobOwn serverIaaSPaaSSaaS
The building and the hardwareYouProviderProviderProvider
The operating system and updatesYouYouProviderProvider
Your appYouYouYouProvider
Your dataYouYouYouYou

The cells students fill in are left blank in this preview.

Compare the total over time

Your own server costs a lot at the start and then a little each month. A rented one costs nothing at the start and the same every month.

So compare the total after some months, not one month. The prices in the table are made up for this lesson. Real prices change and differ between providers.

Worked example: made-up prices

MonthsOwn server: £600, then £15 a monthRented: £40 a monthCheaper
6£690£240Rented
12£780£480Rented
24£960£960The same
36£1,140£1,440Own server

The cells students fill in are left blank in this preview.

A common mistake

Warning

Many people think the cloud is always cheaper. Renting is cheaper for a short time or for work that goes up and down. For steady work over several years, your own server can cost less. Compare the totals for your own case.

The same sums in Python

Code: python
# Made-up prices, in pounds.
buy = 600
upkeep = 15
rent = 40
months = 12
own = buy + upkeep * months
rented = rent * months
print("own", own, "rented", rented)
# Change months to 30. Which is cheaper now?

Going further: more than money

Cost is not the only question. Write three sentences for the cake shop owner.

Say who fixes the server if it breaks at night. Say where the customers' data is kept. Then say what happens if the shop's internet connection goes down.

About this lab and its source: Docker basics lab: learn containers, logs and restarts by fixing a broken service

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.