Cloud computing is the delivery of various services and resources over the internet.
Advantages of cloud computing
- Scalability - Resources can be easily scaled at an instant to meet demands
- Accessibility - Users can access cloud resources and services from any where in the world with an internet connection
- 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.
- High availability - cloud providers offer sophisticated redundancy and fail-over mechanisms to ensure minimal downtime
- Security - Cloud providers offer heavy security measures like encryption, firewall and identity management to prevent cyber attacks
Dis-advantages of cloud computing
- The need for internet connection
- Vendor lock-in and migration challenges
- Limited control - the infrastructure/ service/ resource is owned by the provider
- The cloud provider will have access to the organisation’s sensitive information
Cloud service models
- 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.
- 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.
- 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
- Public
- Services provided over the public internet
- Advantages:
- Cost effective - pay-as-you-go
- Scalability
- Accessibility
- Disadvantages:
- Security
- Limited control
- Ex: AWS, Azure, GCP
- Private
- Dedicated to a single organisation
- Advantages:
- Enhanced security
- Customisation and control
- Disadvantages:
- Higher costs
- Limited scalability in comparison to public clouds
- 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,
- 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.
- 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
Aspect | Virtual Machines (VMs) | Containers |
---|---|---|
Isolation | Full OS-level isolation | Process-level isolation |
Resource Overhead | Higher resource overhead | Lower resource overhead |
Performance | Slightly slower due to hypervisor | Lightweight, faster startup |
Resource Utilization | Less efficient due to overhead | Efficient resource sharing |
Isolation of Dependencies | Independent OS and libraries | Shared OS and libraries |
Portability | More portable due to encapsulated OS | Highly portable |
Startup Time | Slower startup time | Near-instant startup |
Scaling | Can be slower to scale | Faster and more flexible scaling |
Density | Lower density of instances per host | Higher density |
Deployment Complexity | More complex due to VM management | Simpler management |
CI/CD and DevOps | Slower provisioning and deployment | Faster development cycles |
Resource Isolation | Strong isolation, but less granular | Granular process isolation |
Use Cases | Traditional applications requiring strict isolation | Microservices, DevOps, CI/CD |
Storage | Each VM requires its own storage | Shared storage between containers |
Security | More attack surface due to larger OS | Smaller 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