Lecture6 Cloud
Lecture6 Cloud
By:
Dr. Salwa Osama
1
Cloud
• The cloud is made up of very large number of remote servers that are
offered for rent by companies that own these servers.
• Cloud-based servers are ‘virtual servers’, which means that they are
implemented in software rather than hardware.
2
Cloud
• You can rent as many servers as you need, run your software on
these servers and make them available to your customers.
3
Cloud
• Your customers can access these servers from their own computers or
other networked devices such as a tablet or a TV.
• Cloud servers can be started up and shut down as demand changes.
4
Cloud
• You may rent a server and install your own software, or you may pay
for access to software products that are available on the cloud.
5
Benefits of using the cloud for software
development rather than private server
• Cost
• You avoid the initial capital costs of hardware procurement
• Startup time
• You don’t have to wait for hardware to be delivered before you can start
work. Using the cloud, you can have servers up and running in a few minutes.
• Server choice
• If you find that the servers you are renting are not powerful enough, you can
upgrade to more powerful systems. You can add servers for short-term
requirements, such as load testing.
6
Benefits of using the cloud for software
development rather than private server
• Distributed development
• If you have a distributed development team, working from different locations,
all team members have the same development environment and can
seamlessly share all information.
7
Virtual Machine &Virtual Server
• Virtual Machine:
• It is something which acts like a real computer with an OS.
• Physical Server:
• It is a designated or used by single user and it is not shared by multiple users.
• Each physical server has its own OS to run programs and application, memory
hard drive, processors and network connection.
• But if we install a hypervisor on physical server we can create and
manage virtual machine and then all these virtual machines will have
their own resources, OS and server applications.
8
Virtual Machine & Virtual Server
• But if we install a hypervisor on physical server we can create and
manage virtual machine and then all these virtual machines will have
their own resources, OS and server applications.
• Then these virtual machines only can be used for different purposes and if
they are used as a server then they are called virtual server.
9
Virtual machines (VMs), running on
physical server hardware, can be used
to implement virtual servers.
10
Implementing a
virtual server as a
virtual machine
11
Container-based
virtualization
If you are running a cloud-based
system with many instances of
applications or services, these all
use the same operating system,
you can use a simpler virtualization
technology called ‘containers.
12
Container-based virtualization
13
Container-based virtualization
14
Can You Run Windows and Linux Containers
on the Same Machine?
Not natively, no.
But yes, with some conditions and help from virtualization.
You can’t mix and match kernels because containers don’t emulate
operating systems — they share the host kernel.
15
So How Can You Run Both?
Option 1: Use • Docker Desktop uses WSL 2 (Windows Subsystem for Linux v2) to run a
Linux kernel inside Windows.
Docker Desktop • With Docker Desktop:
• You can switch between Linux containers and Windows containers.
(on Windows) • But you can’t run both at the exact same time (natively).
• Containers can be started and shut down in a few seconds rather than
the few minutes required for a VM.
18
Benefits of Containerization
Portability Lightweight
19
Virtual
Container
Machine
20
Docker Terminology
A Docker file is just a simple text file containing all the instructions for building an image.
It allows us to automate the process of creating a consistent and reproducible image for our application
or service.
Once a Dockerfile is created, you can use the docker build command to build a Docker image based on
the instructions in the file.
21
A Docker image is a lightweight, standalone, executable software
package that contains all the necessary components to run an
Terminology
• Once an image is built, you can share, distribute, and run it on any
system that supports Docker.
• You can also store docker images in an online registry (such as Docker
Hub, just one of many registries where you can store images.).
• You can also create versions of the uploaded images to track changes
22
and update your application over time.
Docker Terminology
24
The docker pull command is used to download Docker
images from a registry. This command is essential for
Docker Architecture retrieving the necessary container images before running
them as containers. Docker Hub is the default registry, but
you can also specify other registries.
25
Docker Architecture
26
Docker Architecture
27
Stop Docker → Cloud
28
Everything as a service
The idea of a service that is rented rather than owned is
fundamental to cloud computing.
Infrastructure as a • Cloud providers offer different kinds of infrastructure service such as a
compute service, a network service and a storage service that you can use to
service (IaaS) implement virtual servers.
Platform as a service • This is an intermediate level where you use libraries and frameworks
provided by the cloud provider to implement your software. These provide
(PaaS) access to a range of functions, including SQL and NoSQL databases.
Software as a service • Your software product runs on the cloud and is accessed by users through a
web browser or mobile app.
(SaaS)
29
Figure 5.5 Everything as a service
30
32
Figure 5.8 Advantages and disadvantages of
SaaS for customers
34
Data storage and management issues for SaaS
35
Figure 5.9 Design issues for software
delivered as a service
36
SaaS design issues (1)
• Local/remote processing
• A software product may be designed so that some features are executed locally in the
user’s browser or mobile app and some on a remote server.
• Local execution reduces network traffic and so increases user response speed. This is
useful when users have a slow network connection.
• Local processing increases the electrical power needed to run the system.
• Authentication
• If you set up your own authentication system, users have to remember another set
of authentication credentials.
• Many systems allow authentication using the user’s Google, Facebook or LinkedIn
credentials.
• For business products, you may need to set up a federated authentication system,
which delegates authentication to the business where the user works. 37
SaaS design issues (2)
• Information leakage
• If you have multiple users from multiple organizations, a security risk is
that information leaks from one organization to another.
• There are a number of different ways that this can happen, so you need to
be very careful in designing your security system to avoid this.
38
SaaS design issues (3)
• Multi-tenant and multi-instance systems
• In a multi-tenant system, all customers are served by a single instance of the
system and a multitenant database.
• In a multi-instance system, a separate copy of the system and database is
made available for each user.
Multi-instance
Multi-tenant
39
Multi-tenant systems
• A multi-tenant database is partitioned so that customer companies
have their own space and can store and access their own data.
• There is a single database schema, defined by the SaaS provider, that is
shared by all of the system’s users.
• Items in the database are tagged with a tenant identifier, representing a
company that has stored data in the system. The database access software
uses this tenant identifier to provide ‘logical isolation’, which means that
users seem to be working with their own database.
40
Figure 5.10 An example of a multi-tenant
database
41
Table 5.5 Advantages of multi-tenant
databases
• Resource utilization
The SaaS provider has control of all the resources used by the software and can
optimize the software to make effective use of these resources.
• Security
Multitenant databases have to be designed for security because the data for all
customers is held in the same database. They are, therefore, likely to have fewer
security vulnerabilities than standard database products. Security management is
simplified as there is only a single copy of the database software to be patched if a
security vulnerability is discovered.
• Update management
It is easier to update a single instance of software rather than multiple instances.
Updates are delivered to all customers at the same time so all use the latest
version of the software.
42
Table 5.5 Disadvantages of multi-tenant
databases
• Inflexibility
Customers must all use the same database schema with limited
scope for adapting this schema to individual needs. I explain
possible database adaptations later in this section.
• Security
As data for all customers is maintained in the same database, then
there is a theoretical possibility that data will leak from one
customer to another. In fact, there are very few instances of this
happening. More seriously, perhaps, if there is a database security
breach then it affects all customers.
• Complexity
Multitenant systems are usually more complex than multi-instance
systems because of the need to manage many users. There is,
therefore, an increased likelihood of bugs in the database software.
43
44