Cloud Computing: Services, Types, and Architecture
Cloud computing is the delivery of computing as a service rather than a product, whereby shared resources, software, and information are provided to computers and other devices as a metered service over a network.
Why Cloud Computing Now?
- Experience with very large data centers: Unprecedented economies of scale and transfer of risk.
- Technology factors: Pervasive broadband Internet and maturity in virtualization technology.
- Business factors: Minimal capital expenditure and a pay-as-you-go billing model.
Economics for Cloud Users
Avoids over-provisioning and under-provisioning.
Cloud Applications
- Data-intensive: Refers to tasks or processes that require a significant amount of data to be processed (e.g., social media).
- Compute-intensive: Refers to tasks or processes that require a substantial amount of computational power or processing resources (e.g., weather forecasting models).
- Storage-intensive: Refers to tasks or processes that primarily involve storing, retrieving, or managing a large volume of data in various forms (e.g., Google Drive).
Elasticity
The ability to quickly expand or decrease computer resources (processing, memory, and storage) to meet changing demands without worrying about peak usage.
Ubiquitous Computing
- Physical integration: Invisible, heterogeneous hardware.
- Spontaneous interoperation: Dynamic.
- Casual use: No training required.
- Smart: Proactive and context-aware.
Cloud Challenges
- Vendor lock-in
- Security and privacy
- Data transfer bottleneck
- Large-scale debugging
Infrastructure as a Service (IaaS)
IaaS provides virtualized computing resources over the Internet, allowing users to rent and manage infrastructure components like servers, storage, and networking (e.g., Amazon EC2). Choose IaaS if you:
- Care about lock-in.
- Want complete control.
Platform as a Service (PaaS)
PaaS offers a platform and environment for developers to build, deploy, and manage applications without worrying about the underlying infrastructure (e.g., Google App Engine, Heroku). Choose PaaS if you:
- Have no issue with lock-in.
- Don’t want to or cannot manage servers.
Software as a Service (SaaS)
SaaS delivers software applications over the Internet on a subscription basis. Users access these applications through a web browser, eliminating the need for local installation and maintenance (e.g., Google Docs).
Cloud Types
- Public: Computing infrastructure is hosted at the vendor’s premises.
- Private: Computing infrastructure is dedicated to the customer and is not shared with other organizations.
- Hybrid: Organizations host critical, secure applications in private clouds. Non-critical applications are hosted in the public cloud (Cloud bursting: the organization uses its own infrastructure but uses the cloud for peak loads).
- Community: Shared between organizations from a specific community with common concerns (e.g., universities in Canada).
Customers’ Concerns
- Loss of control
- Data loss and privacy risks
- Risk of intellectual property theft
- Legal and regulatory compliance
Scaling
- Horizontal: Adding more machines into the pool of resources (scaling out). Can be automatic.
- Vertical: Scaling by adding more power (CPU, RAM, Disk) to an existing machine (scaling up).
Cloud Migration Strategies
- Applications migrated to the cloud maintain existing traditional operating models and leverage the ability to manage infrastructure as code through APIs, enabling robust and repeatable build processes, improving reliability.
- Solutions that are refactored leverage higher levels of automation of the operational processes as the supporting services, e.g., AWS Auto Scaling and self-healing architectures.
- Solutions that are re-architected and designed for cloud operations are typically fully automated through DevOps processes for the delivery pipeline and management.
Amazon Web Services (AWS)
Elastic Compute Cloud (EC2)
Offers various instance types (vCPU, Memory, Disk) and pricing (on-demand). You can control how many resources are in use at any given point in time.
Simple Storage Service (S3)
- Minimum of 0 bytes to a maximum of 5 terabytes per object.
- Infinite capacity.
- Object store.
- Web service interface.
- Any format of data.
- Amazon S3 offers a range of storage classes designed for different use cases: Intelligent-Tiering for data with unknown or changing access patterns, Standard-Infrequent Access (S3 Standard-IA), One Zone-Infrequent Access (S3 One Zone-IA) for long-lived, less frequently accessed data, Glacier (S3 Glacier) for backup and archiving, and S3 Glacier Deep Archive (S3 Glacier Deep Archive) for long-term archive.
Elastic Block Store (EBS)
An EBS volume is a virtual disk of a fixed size with a read/write interface. It can be mounted as a file system on a running EC2 instance where it can be updated incrementally. Unlike an instance store, an EBS volume is persistent.
Fundamental Operations
- CREATE a new volume (1GB-1TB).
- COPY a volume from an existing EBS volume or S3 object.
- MOUNT on one instance at a time.
- SNAPSHOT current state to an S3 object.
DynamoDB
- SSD storage.
- Synchronously replicates data across three Availability Zones (AZs) and provides fault tolerance in case of server failure.
- Supports global tables to provide a fully managed, multi-region solution and fast, local, read-write performance.
- Global tables are replicated across your selected AWS Regions.
- Strongly consistent read.
Data Consistency Models
- Eventual consistency reads: Might not reflect the results of a recently completed write operation. After repeating the read request, the latest data response will be returned.
- Strongly consistent read: Returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. (Disadvantages: availability, latency, needs more resources).
Pillars of a Good Cloud Solution
- Efficient Operations: Perform operations as code, annotate documentation, make frequent, small, reversible changes, and refine operations procedures frequently.
- Security: Implement a strong identity foundation, apply security at all layers, protect data in transit and at rest, and keep people away from data.
- Reliability: Test recovery procedures, automatically recover from failure, and scale horizontally or vertically.
- Performance Efficiency: Democratize advanced technologies, go global in minutes, and use serverless architectures.
- Cost Optimization: Adopt a consumption model, measure overall efficiency, and analyze and attribute expenditure.
Relational Database Management System (RDBMS)
Provides
- Relational model with simple schemas.
- Powerful, flexible query language based on Relational Algebra (RA).
- Normalization (minimizes redundancy).
Relational Database ACID Properties
- Atomicity: If one part of the transaction fails, the whole transaction fails; all-or-nothing.
- Consistency: The transaction leaves the database in a valid state.
- Isolation: One transaction doesn’t see an intermediate state of the other.
- Durability: The transaction gets persisted (will survive permanently).
RDBMS Pain Points
- Must design upfront, painful to evolve.
- Transactions are relatively easy on a single machine but slow on multiple machines.
- Storage is expensive.
- Scales well on a single node but is complex to scale on multiple nodes. (For vast, on-demand scalability, a non-relational database is needed).
NoSQL
Features
- Auto-Sharding: A method for distributing data across multiple machines.
- Caching.
- Dynamic Schema.
- Large data volumes (e.g., Google’s “big data”).
- Scalable replication and distribution (potentially thousands of machines, potentially distributed around the world).
- Queries need to return answers quickly.
- Mostly query, few updates.
- Asynchronous inserts and updates.
- CAP Theorem.
- Open-source development.
No ACID – BASE
- Basically Available.
- Soft state.
- Eventually Consistent.
BASE Characteristics
- Weak consistency (stale data OK).
- Availability first.
- Best effort.
- Approximate answers OK.
- Aggressive (optimistic).
- Simpler and faster.
CAP Theorem
A distributed system can support only two of the following:
- Consistency: All nodes in the distributed system see the same data at the same time; every read operation returns the most recent write, ensuring a strong notion of data consistency.
- Availability: Every request made to the distributed system receives a response without guaranteeing that it’s the most recent data; the system is always responsive, even if it might return slightly outdated information.
- Partition Tolerance: The system’s ability to continue functioning even in the presence of network partitions or communication failures between nodes; network partitions can lead to scenarios where some nodes can’t communicate with each other.