Cloud computing is the delivery of various services and resources over the internet.

Advantages of cloud computing

  1. Scalability - Resources can be easily scaled at an instant to meet demands
  2. Accessibility - Users can access cloud resources and services from any where in the world with an internet connection
  3. Cost efficiency - Unlike an on-premise system’s upfront setup and maintainence cost, cloud computing follows the pay-as-you-go model and you only pay for the resources that you use.
  4. High availability - cloud providers offer sophisticated redundancy and fail-over mechanisms to ensure minimal downtime
  5. Security - Cloud providers offer heavy security measures like encryption, firewall and identity management to prevent cyber attacks

Dis-advantages of cloud computing

  1. The need for internet connection
  2. Vendor lock-in and migration challenges
  3. Limited control - the infrastructure/ service/ resource is owned by the provider
  4. The cloud provider will have access to the organisation’s sensitive information

Cloud service models

  1. Infrastructure as a service (IaaS)
    • Provides virtualized computing resources such as VMs, storage and networking components
    • Used by system architects
    • Ex: AWS EC2, Azure VMs, Linode, Google Compute Engine, etc.
  2. Platform as a service (PaaS)
    • Offers a platform and environment for developers to build, deploy and manage applications without worrying about the infrastructure.
    • Used by developers
    • Ex: AWS Elastic Beanstalk, Heroku, Google App Engine, etc.
  3. Software as a Service (SaaS)
    • Delivers software applications over the internet that can be accessed through a browser
    • “on-demand sotware”
    • Used by end-users
    • Ex: Gmail, Google Docs, Salesforce, , etc,

Cloud Deployment models

  1. Public
    • Services provided over the public internet
    • Advantages:
      • Cost effective - pay-as-you-go
      • Scalability
      • Accessibility
    • Disadvantages:
      • Security
      • Limited control
    • Ex: AWS, Azure, GCP
  2. Private
    • Dedicated to a single organisation
    • Advantages:
      • Enhanced security
      • Customisation and control
    • Disadvantages:
      • Higher costs
      • Limited scalability in comparison to public clouds
  3. Hybrid
    • A combination of public and private club, allowing data and applications to be shared between them
    • Advantages:
      • Flexibility - helps achieve both security and scalability
      • Sensitive data can be kept on-premises
      • Cost optimisation - public cloud can be used for temporary workloads
    • Disadvantages:
      • Integration complexity
      • Careful planning of data security during movement is needed

Virtualisation

A technology that allows multiple virtual instances of systems (VMs), applications or storage to run on a single physical hardware

Advantages,

  • Efficient resource utilisation and reduced hardware costs
  • Isolation btw instances ensuring security and reduced risk of failure
  • hardware independence - abstraction help move VMs btw servers

Hardware virtualisation

  • Techniques,
    • Full virtualisation: The OS can run op top of the VM without any modification
    • Para virtualisation: The OS is modified
    • Partial virtualisation: Not complete isolation of the guest OS
    • Hardware assisted virtualisation: Hardware provides architectural support for building the VMM (Virtual Machine Manager)

Hypervisor

  • A software or firmware that creates and manages VMs on a physical host.
  • It handles resource allocation, isolation and even migration in some advanced hypervisors.

Types,

  1. Bare-metal hypervisor (Type 1)
    • Installed directly on the hardware without the need for an underlying OS
    • Offers better performance and resource utilization than type 2 hypervisors
    • Ex: VMWare ESXi, Microsoft Hyper-V, Xen etc.
  2. Hosted hypervisor
    • Installed on top of an OS
    • Generally used for development or personal uses
    • Ex: VMWare Workstation, Oracle VirtualBox, Parallels desktop.

Containerisation

A technology that allows to package and isolate apps along with it’s dependencies and runtime environment into a single unit called “container”.

  • Helps maintain consistency and portability between dev, testing and prod environments

Containers

  • A container is a lightweight standalone executable software package that includes everything that is needed for a software application to run such as code, runtime, dependent libraries and settings.
  • Isolated from the host system to provide interoperability.
  • Container images - Blueprint for creating and running containers

Container Runtime

  • Software responsible for running and managing containers
  • Ex: Docker, Podman, CRI-O, rkt, etc.

VMs vs Contianers

AspectVirtual Machines (VMs)Containers
IsolationFull OS-level isolationProcess-level isolation
Resource OverheadHigher resource overheadLower resource overhead
PerformanceSlightly slower due to hypervisorLightweight, faster startup
Resource UtilizationLess efficient due to overheadEfficient resource sharing
Isolation of DependenciesIndependent OS and librariesShared OS and libraries
PortabilityMore portable due to encapsulated OSHighly portable
Startup TimeSlower startup timeNear-instant startup
ScalingCan be slower to scaleFaster and more flexible scaling
DensityLower density of instances per hostHigher density
Deployment ComplexityMore complex due to VM managementSimpler management
CI/CD and DevOpsSlower provisioning and deploymentFaster development cycles
Resource IsolationStrong isolation, but less granularGranular process isolation
Use CasesTraditional applications requiring strict isolationMicroservices, DevOps, CI/CD
StorageEach VM requires its own storageShared storage between containers
SecurityMore attack surface due to larger OSSmaller attack surface

Scalability

The ability of a system or application or infrastructure to handle an increase in demand while maintaining performance and responsiveness.

Types,

  • Vertical Scaling (Scale Up) - Increasing the capacity of the single machine to handle increased demand - Typically by upgrading hardware - Costlier and has hardware limitations - Simple to manage
  • Horizontal scaling (Scale Out)
    • Adding more machines to handle increased demand
    • Achieved by distributing the workload amongst more machines
    • Cost effective and can be infinitely scaled
    • Increased complexity - requires coordination and load balancing

Auto-scaling

Techniques used to automatically adjust the number of computing resources allocated to an application or service based on it’s current demand.

The process involves monitoring current load on the system and when predefined thresholds are met, the auto-scaling mechanism is triggered to either add (usually scale out) or remove resources (scale in).

  • Flexibility - can handle sudden traffic spikes
  • Cost savings
  • Operational efficiency - reduces need for manual intervention

Serverless Computing

AWS

EC2

  • Elastic Cloud Compute
  • Scalable OSs on the cloud (IaaS)
  • Persistence storage with EBS (Elastic Block Storage)
  • Connects to your own VPC easily
  • Instance types
    • General purpose: Normal web services and containized micro services
    • Compute optimized: High performance web servers
    • Memory optimized: Big Data analytics
    • Accelerated Computing: ML/DL uses, HPC
    • Spot instances: Upto 90% cheaper than on-demand pricing

Mind-map: https://github.com/notcuder/aws-mindmap