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
| Word | What it means | Example |
|---|---|---|
| Cloud service | computing you rent from a provider over the internet | |
| IaaS | renting a bare machine that you look after yourself | |
| PaaS | renting a place to run your app, looked after for you | |
| SaaS | renting a finished app that you just use | web email |
| Scale | add or remove computing power as the work changes | |
| Running cost | what 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
docker ps -aShown here, not run. Create a free account to press Run and type it into your own lab’s terminal.
Which version would you update?
docker exec web nginx -vShown here, not run. Create a free account to press Run and type it into your own lab’s terminal.
How many processors are there?
docker exec web nprocShown 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
| Job | Own server | IaaS | PaaS | SaaS |
|---|---|---|---|---|
| The building and the hardware | You | Provider | Provider | Provider |
| The operating system and updates | You | You | Provider | Provider |
| Your app | You | You | You | Provider |
| Your data | You | You | You | You |
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
| Months | Own server: £600, then £15 a month | Rented: £40 a month | Cheaper |
|---|---|---|---|
| 6 | £690 | £240 | Rented |
| 12 | £780 | £480 | Rented |
| 24 | £960 | £960 | The same |
| 36 | £1,140 | £1,440 | Own 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
# 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.