Cloud Computing Notes
What is a Cloud?
Cloud computing involves providing on-demand computing resources, spanning from applications to data centers, with a pay-per-usage model.
Definition from NIST
According to the National Institute of Standards and Technology (NIST), cloud computing is a model that enables convenient, on-demand network access to a shared pool of configurable computing resources. These resources can be rapidly provisioned and released with minimal management effort or service provider interaction. This includes networks, servers, storage, applications, and services.
Cloud Structure
Single-Site Cloud (Datacenter)
- Computing nodes (servers) are grouped into racks.
- Switches connect the racks.
- Employs a hierarchical network topology.
Distributed Cloud
- Involves multiple data centers, which may have the same or different structures, distributed geographically.
Cloud Computing Characteristics & Models
- 5 Essential Characteristics
- On-demand
- Broad Network Access
- Resource Pooling
- Elasticity
- Measured Service
- 3 Deployment Models
- Public
- Private
- Hybrid
- 3 Service Models
- IaaS (Infrastructure as a Service)
- PaaS (Platform as a Service)
- SaaS (Software as a Service)
Essential Characteristics Explained
- On-demand: Access to cloud resources is available through a simple interface without requiring human support from the service provider.
- Broad Network Access: Resources can be accessed via the network from various platforms like mobile devices and laptops.
- Resource Pooling: Resources are dynamically assigned or reassigned based on demand.
- Elasticity: Users can scale resource usage up or down based on their needs.
- Measured Service: Payment is based on actual usage.
Cloud Computing Evolution
- 1950s: Large-scale mainframes with high-volume processing power introduced time-sharing and resource pooling.
- 1970s: Virtual Machines (VMs) allowed multiple VMs to run on a single physical machine, sharing its resources.
- Virtualization is the key driver for cloud computing, facilitated by hypervisors managing the VMs.
Virtualization
- Virtualization is the process of creating a virtual version of a physical object.
- In computing, hardware virtualization involves creating a virtual version of real hardware, which can be used to run a complete operating system.
Components of Virtualization
- Virtual Machine (VM): A virtual representation of a physical machine.
- Hypervisor: A software application that manages and monitors VMs.
- Host Machine: The physical machine where a guest machine runs.
- Guest Machine: The virtual machine running on the host machine.
Hypervisors
- A hypervisor is responsible for running virtual machines.
- Two types of hypervisors:
- Type 1: Native/Bare Metal
- Type 2: Hosted
- Native Hypervisors: Run directly on the host machines and share resources (e.g., memory, devices) between VMs (e.g., XEN, Oracle VM Server, VMWare ESXi).
- Hosted Hypervisors: Run as an application inside an OS (e.g., VirtualBox, QEMU, UTM, Parallels).
Use Cases for Virtualization
- Isolation: Running untrusted code or providing untrusted users with access to an isolated environment.
- Resource allocation: Limiting the amount of resources per application or user.
- Management: Easy to back up, restore, or even migrate VMs.
- Cross-platform testing: Testing applications on different operating systems.
- Prototyping: Virtualizing an entire network with multiple VMs to emulate switches, routers, and nodes.
- Trying new OSs: Testing new operating systems without altering the host environment.
Containerization
- Containerization is OS-level virtualization.
- It allows deploying and running applications without VMs.
- Containers provide isolated environments, with each container potentially having different files, libraries, and OS configurations.
- Multiple containers (isolated apps) can run on a single host and access the same OS.
Containers vs. VMs
Containers have less overhead compared to VM-based infrastructures.
Docker
- Docker is a popular containerization platform.
- It is used to develop, deploy, and run applications with containers.
- Docker abstracts hardware virtualization for containers and uses a client-server architecture.
Docker Concepts
- Image: A description of an environment.
- Container: A running instantiation of an image.
- Volume: Persistent data storage.
- Dockerfile: Describes what a container needs, including dependencies and source code/binaries.
Dockerfile
A Dockerfile contains a script of instructions to build a container image.
- It can inherit from a parent OS or container.
- It installs required packages or libraries.
- It adds source code or files needed for the application.
- It attaches volumes for persistent data storage.
- It specifies running commands.
Dockerfile Commands
- FROM: Inherits from a parent OS/container (e.g.,
FROM ubuntu). - RUN: Runs commands during the image build (e.g.,
RUN apt install python3). - ADD: Adds files from the source directory to a container image (e.g.,
ADD server.py /app). - EXPOSE: Registers a port that the image will listen to (e.g.,
EXPOSE 8000). - CMD: Specifies the command to be executed (e.g.,
CMD ["python3", "server.py"]).
Building a Docker Image
The Dockerfile is used to build a Docker Image, which is then run to create a Docker Container.
Cloud Service Providers
Examples include AWS, Google Cloud, Microsoft Azure, Alibaba Cloud, IBM Cloud, Oracle Cloud, and SAP.
Deployment Models
Deployment models are based on:
- Location: Where the infrastructure is located.
- Management: Who owns and manages the infrastructure.
- Availability: How resources and services are exposed to users.
Public Cloud
Resources are shared over the public internet, including servers, storage, network, security, and applications.
- Users access resources and services using a simple interface or web console.
- The cloud provider owns and manages the infrastructure.
- Users pay for what they use or use a subscription model.
- Examples: AWS, Azure, Google Cloud.
Private Cloud
According to NIST, a private cloud infrastructure is provisioned for exclusive use by a single organization, comprising multiple consumers such as business units within the organization.
- It may be owned, managed, or operated by the organization, a third party, or a combination of them.
- It can exist on or off premises.
- Can be internal (on-premises) or external (managed by a cloud service provider).
- Virtual private clouds offer public cloud benefits in a private, secure environment (e.g., Amazon).
Hybrid Cloud
Connects on-premise private clouds with third-party public clouds.
- Offers flexibility to choose the right cloud for the application and move workloads based on dynamic load (cloud bursting).
- Allows deploying sensitive workloads in a private cloud and less sensitive workloads in a public cloud.
- Three key principles:
- Flexible
- Scalable
- Portable
Service Models
- Infrastructure as a Service (IaaS)
- Platform as a Service (PaaS)
- Software as a Service (SaaS)
Infrastructure as a Service (IaaS)
Provides processing, storage, networks, and other fundamental computing resources.
- Consumers can deploy and run arbitrary software, including operating systems and applications.
- The consumer does not manage or control the underlying cloud infrastructure but has control over operating systems, storage, deployed applications, and limited control of select networking components.
- Examples: Amazon EC2, Google Cloud, Digital Ocean, Microsoft Azure.
- The provider hosts the infrastructure components and the virtualization layer.
- Consumers can create or provision Virtual Machines (VMs) with preferred operating systems.
- Supports services like auto-scaling and load balancing for scalability and high performance.
Platform as a Service (PaaS)
A cloud computing model that provides a complete application platform to develop, deploy, run, and manage applications.
- Offers support for various programming languages and tools managed by the provider.
- The cloud provider manages the underlying cloud infrastructure, including network, servers, operating systems, and storage.
- Examples: Google App Engine, AWS Elastic Beanstalk.
Software as a Service (SaaS)
Provides access to a service provider’s applications running on cloud infrastructure.
- Accessible from various client devices through a thin client interface such as a web browser (e.g., web-based email).
- Providers manage the underlying cloud infrastructure, including network, servers, operating systems, and storage.
- Providers also manage the application code.
- Examples: Google Apps (e.g., Gmail, Google Docs, Google Sites), Microsoft Office 365, Slack.