Skip to content

AmirHaytham/Cloud-Analytics-Notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Analytics Notes

Cloud Analytics for Data-science Applications Notes ~~premaster's course!

Table of Contents


Outline for Lecture 1 Cloud Introduction

1. Definition of Cloud Computing

  • Delivery of computing services over the internet.
  • Services include: storage, databases, networking, software.

2. Key Characteristics of Cloud Computing

  • On-demand self-service: Provision resources without human intervention.
  • Broad network access: Available via the internet from any device.
  • Resource pooling: Multiple customers share resources dynamically.
  • Rapid elasticity: Scale up or down based on demand.
  • Measured service: Pay-as-you-go pricing model.

3. Service Models

  • IaaS (Infrastructure as a Service): Provides virtualized computing resources.
  • PaaS (Platform as a Service): Offers platforms for application development.
  • SaaS (Software as a Service): Delivers applications over the internet.

4. Deployment Models

  • Public Cloud: Shared by multiple users; accessible via the internet.
  • Private Cloud: Dedicated infrastructure for a single organization.
  • Hybrid Cloud: Combines public and private clouds.
  • Community Cloud: Shared among organizations with similar requirements.

5. Benefits of Cloud Computing

  • Cost efficiency (no upfront hardware investment).
  • Scalability and elasticity.
  • Disaster recovery and business continuity.
  • Accessibility and collaboration.

6. Challenges of Cloud Computing

  • Data security and privacy.
  • Downtime risks.
  • Compliance with regulations.
  • Vendor lock-in concerns.

Answers to Potential Questions from Lecture 1

1. Define cloud computing in your own words.

Answer: Cloud computing is the delivery of various computing services (e.g., servers, storage, databases) over the internet, allowing users to access and pay for only what they use.


2. What are the five essential characteristics of cloud computing?

Answer:

  1. On-demand self-service: Provision resources automatically.
  2. Broad network access: Access services from anywhere with internet.
  3. Resource pooling: Shared resources for efficiency.
  4. Rapid elasticity: Adjust resources to match workload changes.
  5. Measured service: Billing based on actual usage.

3. Differentiate between IaaS, PaaS, and SaaS with examples.

Answer:

  • IaaS (e.g., AWS EC2): Provides virtual servers and storage for users to manage.
  • PaaS (e.g., AWS Elastic Beanstalk): Offers platforms for developers to deploy applications.
  • SaaS (e.g., Google Workspace): Delivers ready-to-use software applications.

4. Explain the key differences between public, private, and hybrid clouds.

Answer:

  • Public Cloud: Accessible to anyone; lower cost but less control.
  • Private Cloud: Exclusive use for one organization; more secure.
  • Hybrid Cloud: Combines public and private, offering flexibility.

5. Why is resource pooling important in cloud computing?

Answer: Resource pooling ensures efficient use of infrastructure by sharing resources among multiple users, reducing costs and enabling scalability.


6. What are the main challenges businesses face with cloud computing?

Answer:

  • Data Security: Risk of breaches and unauthorized access.
  • Downtime: Dependence on internet availability and provider uptime.
  • Compliance: Meeting regulations like GDPR or HIPAA.
  • Vendor Lock-in: Difficulty switching providers due to compatibility issues

Outline for Lecture 2: AWS Resources

1. Overview of AWS

  • Leading cloud service provider offering scalable and flexible solutions.
  • Covers computing, storage, databases, networking, and more.

2. Key AWS Services

  • Compute: EC2 (Elastic Compute Cloud), Lambda.
  • Storage: S3 (Simple Storage Service), EBS (Elastic Block Store).
  • Databases: RDS, DynamoDB, Aurora.
  • Networking: VPC (Virtual Private Cloud), Route 53.

3. Amazon EC2

  • Provides resizable compute capacity in the cloud.
  • Types of instances: General purpose, Compute optimized, Storage optimized, etc.
  • Features: Auto-scaling, Elastic Load Balancer, Key Pairs.

4. Amazon S3

  • Object storage service with virtually unlimited capacity.
  • Use cases: Backup and restore, data archiving, static website hosting.
  • Features: Buckets, versioning, access control, lifecycle policies.

5. Identity and Access Management (IAM)

  • Manages access to AWS resources securely.
  • Components: Users, Groups, Policies, Roles.
  • Provides fine-grained access control.

6. AWS VPC (Virtual Private Cloud)

  • Allows users to create an isolated virtual network.
  • Components: Subnets, Route tables, Gateways, Security groups.
  • Provides full control over networking.

7. Monitoring and Management

  • CloudWatch: Monitors AWS resources and applications.
  • CloudTrail: Logs AWS API calls for auditing and compliance.

8. Shared Responsibility Model

  • AWS is responsible for "security of the cloud" (infrastructure).
  • Customers are responsible for "security in the cloud" (data, permissions).

Answers to Potential Questions from Lecture 2

1. What is the purpose of Amazon EC2, and what are its use cases?

Answer:
Amazon EC2 provides scalable, resizable compute capacity in the cloud.
Use Cases:

  • Hosting web applications.
  • Running batch processing jobs.
  • Supporting distributed applications.

2. Differentiate between Amazon S3 and Amazon EBS.

Answer:

  • S3: Object storage for scalable, unstructured data storage (e.g., backups, data lakes).
  • EBS: Block storage for persistent data attached to EC2 instances (e.g., OS storage, databases).

3. Explain the components of AWS IAM and their purposes.

Answer:

  • Users: Individuals with specific credentials.
  • Groups: Collections of users sharing permissions.
  • Policies: JSON documents defining access permissions.
  • Roles: Temporary access for AWS services or external entities.

4. What is the role of VPC in AWS architecture?

Answer:
AWS VPC allows users to create isolated virtual networks, providing control over IP ranges, subnets, routing tables, and security groups. It ensures secure networking for AWS resources.


5. What are the main differences between CloudWatch and CloudTrail?

Answer:

  • CloudWatch: Monitors operational metrics (e.g., CPU usage, disk I/O).
  • CloudTrail: Logs API activity for auditing and compliance.

6. Describe the shared responsibility model in AWS.

Answer:
AWS is responsible for infrastructure security (e.g., hardware, network). Customers are responsible for managing data, user access, and application security.


7. What are lifecycle policies in Amazon S3?

Answer: Lifecycle policies automate the transition of data between S3 storage classes or delete objects after a set period. This reduces storage costs.


8. How does auto-scaling improve application performance?

Answer: Auto-scaling automatically adjusts the number of EC2 instances based on demand, ensuring optimal performance during traffic spikes while reducing costs during low activity.


9. Why is IAM essential for cloud security?

Answer: IAM provides fine-grained access control, enabling organizations to grant the least privilege necessary for resources, reducing risks of unauthorized access.


10. List and explain different instance types in EC2.

Answer:

  • General Purpose: Balanced performance (e.g., t2.micro).
  • Compute Optimized: For high-performance computing (e.g., c5.large).
  • Memory Optimized: For in-memory databases (e.g., r5.large).
  • Storage Optimized: For intensive read/write workloads (e.g., i3.large).

Outline for Lecture 3: Data Warehousing

1. Overview of Data Warehousing

  • Definition: A data warehouse is a centralized repository for structured, historical data used for analysis and decision-making.
  • Features: Subject-oriented, integrated, time-variant, and non-volatile.
  • Purpose: Support business intelligence, reporting, and data mining.

2. Key Components of a Data Warehouse

  • Data Sources: Operational databases, flat files, external systems.
  • Staging Area: Prepares raw data through ETL processes.
  • Data Warehouse: Central repository for cleansed, consolidated data.
  • Data Marts: Subsets of data tailored for specific departments or functions.

3. ETL Process (Extract, Transform, Load)

  • Extract: Collect data from multiple sources.
  • Transform: Cleanse, validate, and convert data into a consistent format.
  • Load: Store transformed data into the warehouse.

4. Data Warehouse Architectures

  • Top-Down Approach: Centralized warehouse created first, followed by data marts.
  • Bottom-Up Approach: Independent data marts created first, integrated later.

5. OLAP vs. OLTP

  • OLAP (Online Analytical Processing): Optimized for data analysis, uses multidimensional models (e.g., star schema).
  • OLTP (Online Transaction Processing): Handles daily transactional operations, uses relational models.

6. Schema Designs in Data Warehousing

  • Star Schema: Central fact table connected to denormalized dimension tables.
  • Snowflake Schema: Dimension tables further normalized.

7. Benefits of Data Warehousing

  • Centralized data for consistent reporting.
  • Historical data storage for trend analysis.
  • Faster query performance for complex analytics.

8. Challenges in Data Warehousing

  • High implementation cost.
  • Complex ETL processes.
  • Data quality and integration issues.

Answers to Potential Questions from Lecture 3

1. What is a data warehouse, and why is it important?

Answer:
A data warehouse is a centralized repository that integrates data from multiple sources for analysis. It supports business intelligence, trend analysis, and decision-making by providing consistent, historical data.


2. Explain the four characteristics of a data warehouse.

Answer:

  • Subject-Oriented: Organized around key business subjects like sales or customers.
  • Integrated: Consolidates data from various sources into a unified format.
  • Time-Variant: Stores historical data, enabling trend analysis over time.
  • Non-Volatile: Data is stable and not subject to frequent changes.

3. Differentiate between OLAP and OLTP.

Answer:

  • OLAP:

    • Purpose: Data analysis and reporting.
    • Schema: Star or snowflake.
    • Example: Sales trend analysis.
  • OLTP:

    • Purpose: Daily transaction processing.
    • Schema: Normalized relational models.
    • Example: Online order processing.

4. What are the main steps in the ETL process?

Answer:

  1. Extract: Retrieve data from source systems.
  2. Transform: Clean, standardize, and validate data.
  3. Load: Insert the processed data into the data warehouse.

5. Compare the top-down and bottom-up approaches in data warehouse design.

Answer:

  • Top-Down Approach:

    • Centralized warehouse created first, followed by departmental data marts.
    • Advantage: Strong consistency across the organization.
    • Disadvantage: High cost and longer implementation time.
  • Bottom-Up Approach:

    • Data marts are built first and later integrated into a central warehouse.
    • Advantage: Faster and cost-effective for small organizations.
    • Disadvantage: Risk of inconsistent data.

6. Describe the star schema and its components.

Answer:

  • Star Schema: A denormalized structure with:
    • Fact Table: Contains metrics like sales amount or quantities.
    • Dimension Tables: Describe dimensions like time, location, or product.

7. What are the main benefits of using a data warehouse?

Answer:

  • Improved decision-making through unified, historical data.
  • Faster analytics with optimized query performance.
  • Simplifies reporting by providing a single source of truth.

8. What are the challenges faced during data warehousing implementation?

Answer:

  • Complex ETL processes.
  • Maintaining data quality and consistency.
  • High implementation and maintenance costs.

9. What is the purpose of data marts in a data warehouse?

Answer:
Data marts store subsets of data tailored for specific departments or functions, such as finance or marketing, enabling faster and more focused analysis.


10. Explain the role of the staging area in a data warehouse.

Answer:
The staging area temporarily holds raw data from source systems for cleansing and transformation before loading it into the data warehouse.

Outline for Lecture 4: AWS Redshift

1. Overview of Amazon Redshift

  • Fully managed, scalable data warehouse service.
  • Optimized for analytics and business intelligence workloads.
  • Supports petabyte-scale data storage and querying.

2. Key Features of Amazon Redshift

  • Columnar Storage: Stores data in columns for faster analytical queries.
  • Massively Parallel Processing (MPP): Distributes data and queries across multiple nodes.
  • Compression: Reduces storage costs by compressing columnar data.
  • Concurrency Scaling: Handles spikes in query loads.
  • Integration with AWS Services: Seamlessly connects to S3, Glue, and QuickSight.

3. Data Distribution in Redshift

  • Distribution Styles:
    • KEY: Based on the values of a specified column.
    • EVEN: Data evenly distributed across nodes.
    • ALL: Replicates entire table on all nodes (for small tables).
  • Optimizes data placement for query performance.

4. Query Optimization

  • Sort Keys: Determines the order of data storage for faster queries.
  • Distribution Keys: Ensures efficient data placement across nodes.
  • Vacuuming and Analyzing: Keeps data organized and up-to-date.

5. Loading Data into Redshift

  • Sources: S3, DynamoDB, Kinesis, or on-premises databases.
  • COPY Command: Efficiently loads data from S3 or other sources.
  • Best Practices: Use compression and split data into smaller files.

6. Redshift Clusters

  • Node Types:
    • Leader Node: Manages query execution and result aggregation.
    • Compute Nodes: Store data and execute queries.
  • Scaling clusters to handle growing workloads.

7. Security in Redshift

  • Encryption at rest and in transit.
  • Role-based access control via IAM.
  • VPC for network isolation.

8. Use Cases

  • BI and reporting.
  • Big data analytics.
  • Data consolidation from multiple sources.

Answers to Potential Questions from Lecture 4

1. What is Amazon Redshift, and what are its main use cases?

Answer:
Amazon Redshift is a fully managed data warehouse service optimized for large-scale data analytics.
Use Cases:

  • Business intelligence and reporting.
  • Analyzing historical data for trends.
  • Consolidating data from multiple sources for a unified view.

2. Explain how Redshift uses columnar storage and MPP.

Answer:

  • Columnar Storage: Redshift stores data by columns instead of rows, enabling faster read performance for analytical queries.
  • Massively Parallel Processing (MPP): Queries are distributed across multiple nodes, allowing parallel execution and faster results.

3. Differentiate between the three distribution styles in Redshift.

Answer:

  • KEY: Data is distributed based on the values in a specified column, ensuring related rows are stored on the same node.
  • EVEN: Data is evenly distributed across all nodes for uniform workloads.
  • ALL: Replicates entire tables across all nodes, useful for small tables used in many joins.

4. What are sort keys, and why are they important in Redshift?

Answer:
Sort keys determine the order of data storage. Queries filtering or aggregating data based on the sort key can skip unnecessary rows, improving performance.


5. Describe the steps involved in loading data into Redshift using the COPY command.

Answer:

  1. Upload data to an S3 bucket.

  2. Grant Redshift access to the S3 bucket using an IAM role.

  3. Use the COPY command to load data:

    COPY table_name FROM 's3://bucket-name/file'  
    IAM_ROLE 'arn:aws:iam::account-id:role/role-name'  
    FORMAT AS CSV;

6. What is the role of the leader node and compute nodes in Redshift clusters?

Answer:

  • Leader Node: Manages query parsing, optimization, and result aggregation.
  • Compute Nodes: Execute queries and store data distributed across them.

7. How does Redshift ensure data security?

Answer:

  • Encryption: Encrypts data at rest (e.g., with AWS KMS) and in transit (e.g., TLS).
  • IAM Integration: Role-based access control.
  • VPC: Provides network isolation.

8. What are the best practices for optimizing query performance in Redshift?

Answer:

  • Choose appropriate distribution keys and sort keys.
  • Regularly VACUUM and ANALYZE tables.
  • Use compression to reduce I/O and storage costs.
  • Split data into smaller files for faster ingestion.

9. How does concurrency scaling improve Redshift’s performance?

Answer:
Concurrency scaling allows Redshift to add temporary clusters during high query loads, ensuring consistent performance without delays.


10. Compare Redshift with traditional on-premises data warehouses.

Answer:

  • Redshift: Cloud-based, scalable, and fully managed. Supports columnar storage and MPP.
  • On-Premises: Requires hardware investment and manual management. Typically row-based storage.

Outline for Lecture 5: AWS Glue and Athena

1. Overview of AWS Glue

  • Fully managed Extract, Transform, Load (ETL) service.
  • Automates schema discovery, data transformation, and job execution.
  • Key components: Glue Data Catalog, Crawlers, Jobs, and Triggers.

2. AWS Glue Components

  • Data Catalog: Centralized metadata repository.
  • Crawlers: Automatically detect and infer schema for datasets.
  • Jobs: Perform data transformations and loading.
  • Triggers: Automate workflows based on schedules or events.

3. AWS Glue Use Cases

  • ETL workflows for cleaning and transforming data.
  • Data integration from various sources to S3, Redshift, or RDS.
  • Schema discovery and metadata management.

4. Overview of AWS Athena

  • Serverless query service for analyzing data stored in S3.
  • Uses standard SQL for querying.
  • No infrastructure management; pay-per-query pricing.

5. Key Features of AWS Athena

  • Supports various data formats (e.g., CSV, Parquet, JSON).
  • Integrates with AWS Glue Data Catalog for schema management.
  • Supports partitioning for query optimization.

6. Comparing Glue and Athena

  • Glue: Focuses on ETL and data preparation.
  • Athena: Focuses on querying and analyzing prepared data.
  • Integration: Glue prepares data and registers schemas; Athena queries it.

7. Use Cases for Glue and Athena

  • Building data lakes with S3.
  • Ad-hoc querying for data exploration and reporting.
  • Data preprocessing for machine learning or analytics.

8. Best Practices

  • Use Glue Crawlers for schema automation.
  • Partition data in S3 for faster queries in Athena.
  • Optimize file formats (e.g., Parquet) to reduce query costs.

Answers to Potential Questions from Lecture 5

1. What is AWS Glue, and what are its main components?

Answer: AWS Glue is a fully managed ETL service for automating data preparation.
Main Components:

  • Data Catalog: Metadata repository for datasets.
  • Crawlers: Detect and infer schema automatically.
  • Jobs: Execute ETL workflows.
  • Triggers: Schedule or automate workflows.

2. Explain the purpose of Glue Crawlers.

Answer: Crawlers scan datasets (e.g., in S3) to infer schema and create or update tables in the Glue Data Catalog. This reduces manual effort in defining data structures.


3. What is the Glue Data Catalog, and why is it important?

Answer: The Glue Data Catalog is a centralized repository for metadata, including table definitions and schema. It ensures consistent data management and integrates seamlessly with Athena.


4. How does AWS Athena query data?

Answer: Athena queries data stored in S3 using SQL. It directly interacts with the Glue Data Catalog for schema information, enabling serverless and scalable analytics.


5. What are the main differences between Glue and Athena?

Answer:

  • Glue: Focused on ETL for data preparation and integration.
  • Athena: Designed for querying and analyzing prepared data.
    Glue is typically used to preprocess data, while Athena provides analysis capabilities.

6. Describe a typical workflow using AWS Glue and Athena.

Answer:

  1. Use Glue Crawlers to discover schemas and populate the Data Catalog.
  2. Run Glue Jobs to clean, transform, and store data in S3.
  3. Query the prepared data in S3 using Athena with SQL.

7. What are the benefits of using Athena for querying S3 data?

Answer:

  • Serverless architecture; no infrastructure management.
  • Pay-per-query model reduces costs for infrequent usage.
  • Supports multiple file formats and integrates with Glue for schema management.

8. How can partitioning improve query performance in Athena?

Answer: Partitioning organizes data by specific keys (e.g., date), enabling Athena to scan only relevant data partitions instead of the entire dataset.


9. What are the advantages of using Parquet or ORC formats with Glue and Athena?

Answer: These columnar file formats reduce storage requirements and improve query performance by minimizing data scanned.


10. List some common use cases for Glue and Athena integration.

Answer:

  • Building data lakes for scalable storage and querying.
  • Ad-hoc analytics on raw or processed data in S3.
  • ETL workflows for preprocessing data for reporting or machine learning.

Outline for Lecture 6: AWS QuickSight

1. Overview of Amazon QuickSight

  • Cloud-based Business Intelligence (BI) service.
  • Creates interactive dashboards and data visualizations.
  • Accessible from any device with a web browser.

2. Key Features of Amazon QuickSight

  • Interactive Dashboards: Real-time, visually rich analytics.
  • SPICE Engine: Super-fast, Parallel, In-memory Calculation Engine for faster query execution.
  • Natural Language Querying: Amazon Q allows users to ask questions in plain language.
  • Integration: Works with AWS services like Redshift, Athena, S3, RDS, and other data sources.
  • Machine Learning Insights: Offers anomaly detection and forecasting.
  • Sharing & Collaboration: Share dashboards securely with team members.

3. QuickSight Data Flow

  1. Connect Data Sources: (e.g., S3, Redshift, Athena).
  2. Import and Prepare Data: Use datasets and SPICE for analysis.
  3. Create Visualizations: Charts, tables, and graphs.
  4. Publish Dashboards: Monitor metrics and aid decision-making.

4. SPICE (In-Memory Engine)

  • Stores data in-memory for faster querying.
  • Enables fast performance for multiple users querying the same data.
  • Scales efficiently to handle large datasets.

5. Integration with AWS Services

  • Redshift: Direct connection for large-scale analytics.
  • Athena: Queries raw data stored in S3.
  • S3: Stores data for visualization.
  • Glue: Prepares and catalogs data with the Data Catalog.

6. Benefits of QuickSight

  • Scalability: Adapts to growing data and user requirements.
  • Cost-Effective: Pay-per-session pricing.
  • Ease of Use: Intuitive interface for non-technical users.
  • Security: Role-based access control with IAM integration.

7. QuickSight Use Cases

  • Business Reporting and Dashboards.
  • Real-Time Operational Monitoring.
  • Ad-Hoc Analysis and Predictive Modeling.

8. Best Practices

  1. Use SPICE for high-performance dashboards.
  2. Optimize datasets for efficient querying.
  3. Leverage machine learning features for advanced analytics.

Answers to Potential Questions from Lecture 6

1. What is Amazon QuickSight, and what are its key features?

Answer:

  • Amazon QuickSight is a cloud-based BI service for creating dashboards and visualizations.

Key Features:

  • Interactive dashboards with real-time insights.
  • SPICE engine for fast, in-memory data processing.
  • Natural language querying with Amazon Q.
  • Seamless integration with AWS services like Redshift and Athena.

2. How does the SPICE engine enhance QuickSight performance?

Answer:

  • SPICE (Super-fast, Parallel, In-memory Calculation Engine) stores data in-memory, enabling:
    • Faster queries.
    • Support for multiple users querying the same dataset simultaneously.

3. Describe the steps to create a dashboard in QuickSight.

Answer:

  1. Connect to a data source (e.g., S3, Redshift).
  2. Prepare and import data into SPICE.
  3. Create visualizations using charts, graphs, or tables.
  4. Publish and share the dashboard with stakeholders.

4. How does QuickSight integrate with other AWS services?

Answer:

  • Redshift: Provides direct connectivity for querying large-scale data.
  • Athena: Analyzes raw data stored in S3 using SQL.
  • Glue: Prepares and catalogs data for analysis.
  • S3: Stores data files for visualization.

5. What are the benefits of using Amazon Q in QuickSight?

Answer:

  • Amazon Q allows users to interact with data by asking questions in natural language (e.g., "What were last month's sales?").
  • Simplifies analytics for non-technical users.

6. What is the pricing model for QuickSight?

Answer:

  • QuickSight uses a pay-per-session pricing model:
    • Users are charged only for active sessions.
    • Cost-effective for organizations with varying usage levels.

7. What types of data visualizations can QuickSight create?

Answer:

  • Bar charts, line graphs, and pie charts.
  • Heat maps and scatter plots.
  • Tables and pivot tables.
  • Geographic maps for spatial data.

8. How can QuickSight be used for real-time monitoring?

Answer:

  • Integrates with CloudWatch and other AWS services.
  • Creates dashboards that display metrics and alerts in real-time.
  • Enables effective operational monitoring.

9. Compare SPICE and live querying in QuickSight.

Answer:

SPICE Live Querying
Stores data in-memory for faster access. Queries data directly from the source.
Ideal for frequently queried datasets. Ensures up-to-date results.
High performance for multiple users. Dependent on the source system's performance.

10. What are common use cases for Amazon QuickSight?

Answer:

  1. Business Intelligence Dashboards for executives.
  2. Operational Monitoring of real-time metrics.
  3. Analyzing historical trends and forecasting future outcomes.

Diagrams - AWS Architecture and Services Overview

Diagrams include EC2 Overview, AMI Workflow, EC2 Lifecycle, VPC Network - VPC Architecture Diagram, VPC Architecture with Subnets, VPC Region and IP Range, Subnet Configuration, ACL, ACL (Access Control List) in VPC, Security Groups, Storage Types Overview, Block vs. Object Storage, S3 URL Breakdow, CloudFormation Workflow, Load Balancer Target Groups, Autoscaling & Load Balancing, and Advanced Autoscaling & Load Balancing.

EC2 Overview Diagram

EC2 Overview The image provides an overview of Amazon EC2 (Elastic Compute Cloud), focusing on instance types and sizes.


Instance Types

Amazon EC2 offers several instance types tailored for different workloads:

  1. General Purpose:

    • Balanced workloads for computing, memory, and networking.
    • Example Use Cases: Web servers, development/test environments.
  2. Compute Optimized:

    • For compute-heavy applications requiring high performance.
    • Example Use Cases: Machine learning, high-performance web servers.
  3. Memory Optimized:

    • Ideal for memory-intensive applications.
    • Example Use Cases: In-memory databases, real-time big data processing.
  4. Accelerated Computing:

    • Designed for tasks requiring specialized hardware like GPUs.
    • Example Use Cases: Machine learning training, graphic rendering.
  5. Storage Optimized:

    • Suited for high I/O workloads needing fast, large-scale storage.
    • Example Use Cases: Data warehouses, distributed file systems.
  6. HPC Optimized:

    • High-performance computing for scientific modeling and simulations.
    • Example Use Cases: Genomics, financial modeling.

Instance Sizes

Instances are categorized by size, represented by a combination of a type prefix and a size suffix (e.g., t3.medium, a1.large):

  • Prefix (e.g., "t3"): Indicates the instance type.
  • Suffix (e.g., "medium"): Determines the CPU and memory configuration.

Resources in Table

The table provides examples of virtual CPUs (vCPUs) and their corresponding capabilities for different instance types:

Instance Type vCPU Memory (GB) Special Notes
t3.micro 2 1 General-purpose, burstable CPU.
c5.large 2 4 Compute-optimized.
r5.xlarge 4 32 Memory-optimized.
g4dn.xlarge 4 16 Accelerated computing with GPUs.
i3.large 2 8 Storage-optimized with NVMe SSD.
hpc6a.48xlarge 96 384 HPC-optimized for high scalability.

AMI Workflow Diagram

AMI Workflow Diagram

Description

What is an AMI?

  • An Amazon Machine Image (AMI) is a pre-configured template used to launch EC2 instances.
  • Includes essential components:
    • Operating system.
    • Application server.
    • Pre-installed applications.
  • Eliminates the need for manual operating system installation and server setup, enabling faster deployments.

Diagram Details

Top Section:

  • Demonstrates how an AMI is used to create an EC2 instance.
  • The instance includes:
    • Root Volume: Attached storage for the instance.

Bottom Section:

  • Highlights the reusability of AMIs:
    1. AMI #1: Used to create Instance #1.
    2. New AMI: After modifications to Instance #1, a new AMI is created.
    3. Reusability: The new AMI is then used to launch additional instances.

Key Benefits of AMIs

  1. Streamlined Instance Launching:
    • Pre-configured templates save time and reduce manual setup.
  2. Consistency:
    • Reusable AMIs ensure uniformity across instances.
  3. Version Control:
    • Easily update and save new versions of AMIs after modifications.
  4. Scalability:
    • Launch multiple instances from the same AMI for large-scale applications.

EC2 Lifecycle Diagram

AMI Workflow Diagram

Description

Lifecycle Phases

Amazon EC2 instances go through several lifecycle states, each with distinct characteristics and implications for billing and resource management:

  1. Pending:

    • The instance is in the process of launching.
    • Billing has not yet started.
  2. Running:

    • The instance is active and operational.
    • Billing begins in this state.
  3. Stopping/Stopped:

    • The instance transitions to a stopped state.
    • For EBS-backed instances:
      • Data on the root volume is retained.
      • Billing for computing stops, but charges for storage continue.
  4. Rebooting:

    • A temporary restart of the instance.
    • No data is lost during this phase.
    • Billing continues without interruption.
  5. Terminated:

    • The instance is permanently deleted.
    • Associated resources, such as storage volumes, are released (unless marked to persist).

Relevance

Understanding the lifecycle states of EC2 instances is essential for:

  1. Cost Management:

    • Ensure unused instances are stopped or terminated to minimize costs.
  2. Resource Optimization:

    • Manage instance states efficiently to match application requirements.
  3. Data Retention:

    • Recognize when data persists (e.g., stopped instances with EBS) versus when it is permanently deleted (e.g., terminated instances).

VPC Network - VPC Architecture Diagram

VPC Network - VPC Architecture Diagram

What is a VPC?

  • A Virtual Private Cloud (VPC) is a logically isolated network within AWS.
  • Enables complete control over networking, including:
    • Subnets: Logical subdivisions of the VPC.
    • Security Groups: Act as virtual firewalls for instance-level access control.
    • Network Access Configurations: Define routing and internet access.

Diagram Highlights

Components:

  1. Public Subnet:

    • Hosts resources accessible from the internet, such as EC2 instances.
    • Uses an Internet Gateway (IGW) for connectivity.
  2. Private Subnet:

    • Isolated from direct internet access.
    • Ideal for sensitive resources like databases (e.g., Amazon RDS).
    • Internet access for private resources is managed via a NAT Gateway or NAT Instance.
  3. Availability Zones (AZs):

    • Two zones (e.g., AZ A and AZ B) are shown for redundancy and fault tolerance.
    • Resources are distributed across AZs to improve high availability.
  4. Access Control:

    • Security Groups: Define inbound and outbound traffic rules for instances.
    • Network ACLs (NACLs): Optional, subnet-level rules for additional traffic control.
  5. Corporate Connectivity:

    • Integration with on-premises data centers is shown via:
      • VPN: Secure connections over the internet.
      • AWS Direct Connect: Dedicated, high-speed private connections.

Key Benefits of VPC:

  1. Customizable Networking:

    • Configure IP ranges, subnets, route tables, and gateways.
  2. Secure Resource Isolation:

    • Resources are isolated at the network level for enhanced security.
  3. Seamless Hybrid Connectivity:

    • Combine on-premises data centers with AWS resources.

VPC Routing Diagram - VPC Architecture with Subnets

VPC Routing Diagram - VPC Architecture with Subnets

Main Route Table

  • Default route table for the VPC.
  • Handles local traffic:
    • Example: Traffic within the VPC (e.g., 10.1.0.0/16) is routed locally.
  • Does not allow internet access.

Custom Route Table

  • A user-defined route table with additional configurations.
  • Allows internet access:
    • Example: Routes traffic to an Internet Gateway (IGW) for external communication.
    • Destination: 0.0.0.0/0 (represents all IP addresses outside the VPC).

Subnets Overview

1. Public Subnet

  • Connected to the Internet Gateway for external access.
  • Resources in this subnet (e.g., EC2 instances) are accessible from the internet.

2. Private Subnet

  • Isolated from direct internet access.
  • Traffic remains within the VPC or uses a NAT Gateway (if configured) for outbound internet access.
  • Red X: Represents a blocked pathway for internet traffic directly from the private subnet.

Key Points

  1. Main Route Table: Restricts traffic to remain within the VPC.
  2. Custom Route Table: Enables internet access via an Internet Gateway.
  3. Subnet Differentiation:
    • Public Subnet: Internet-enabled.
    • Private Subnet: Internet-isolated.

Subnet IP Ranges

Subnet Configuration

Subnet IP Ranges

  1. Public Subnet:

    • CIDR Block: 10.1.1.0/24.
    • Supports up to 256 IP addresses.
    • Allows internet access via an Internet Gateway.
  2. Private Subnet:

    • CIDR Block: 10.1.3.0/24.
    • Supports up to 256 IP addresses.
    • Isolated from the internet for hosting secure resources like databases.

Non-Overlapping Subnets

  • Both subnets are distinct subsets of the VPC's IP range (10.1.0.0/16).
  • Ensures there is no overlap, avoiding conflicts in resource allocation.

Availability Zone

  • Both subnets are deployed in Zone A of the selected AWS region.
  • Regional zones improve redundancy and fault tolerance for resources.

Public vs. Private Subnet

Subnet Type Internet Access Use Case
Public Yes (via Internet Gateway) Hosting public-facing resources like EC2 instances or web servers.
Private No (isolated) Securely hosting sensitive resources like databases or backend applications.

VPC Region and IP Range

VPC Region and IP Range

Region

  • The VPC is deployed in the AWS region N. Virginia (us-east-1).
  • Regional placement ensures optimized latency and redundancy for resources.

IP Range

  • The VPC is assigned the CIDR block: 10.1.0.0/16.
    • Supports up to 65,536 IP addresses within this range.
    • Provides flexibility to define smaller subnets within the VPC.

Purpose

  • Demonstrates the scope of available IP addresses for:
    • Subnets.
    • EC2 instances.
    • Other resources within the VPC.
  • Ensures sufficient IP allocation for scaling applications and supporting complex architectures.

ACL

AMI Workflow Diagram

Rules for Public and Private Subnets

  • Public Subnet:
    • Allow inbound HTTP/HTTPS.
    • Allow inbound SSH.
  • Private Subnet:
    • Allow inbound from public subnet for application traffic.
    • Deny all other inbound traffic.

ACL (Access Control List) in VPC

ACL (Access Control List) in VPC

What is an ACL?

  • A Network Access Control List (ACL) is a network-level security mechanism in AWS.
  • Operates at the subnet boundary, providing an additional layer of security.
  • Configured to allow or deny specific traffic based on defined rules.

Key Features

  1. Stateless:
    • Inbound and outbound rules are evaluated separately.
  2. Subnet-level Protection:
    • ACLs apply to all resources within a subnet.
  3. Rule Evaluation:
    • Rules are evaluated in numerical order (from lowest to highest).

Diagram Highlights

Subnets:

  1. Public Subnet:
    • Used for internet-facing resources.
    • ACL rules permit inbound HTTP/HTTPS traffic and SSH access.
  2. Private Subnet:
    • Hosts sensitive resources like databases.
    • ACL rules restrict inbound traffic, allowing only necessary communication from the public subnet.

Availability Zones:

  • Two zones (A and B) provide redundancy:
    • Each zone contains both public and private subnets.
    • ACLs are applied consistently across all subnets for uniform security.

Purpose of ACLs

  1. Enhanced Security:
    • Adds an extra layer of protection alongside Security Groups.
  2. Granular Traffic Control:
    • Allows fine-tuning of allowed and denied traffic at the subnet level.
  3. Support for Multi-Subnet Architectures:
    • Ensures secure communication between public and private subnets in multi-AZ deployments.

Security Groups Diagram

Security Groups Diagram

What are Security Groups?

  • A Security Group acts as a virtual firewall for EC2 instances.
  • Controls inbound and outbound traffic for individual instances.
  • Operates at the instance level, offering fine-grained control over traffic.

Key Features

  1. Stateful:
    • Automatically allows return traffic for permitted inbound or outbound requests.
  2. Instance-Level Protection:
    • Unlike ACLs, security groups are applied directly to EC2 instances.
  3. Customizable Rules:
    • Rules specify:
      • Allowed ports (e.g., 22 for SSH, 80 for HTTP).
      • Allowed protocols (e.g., TCP, UDP).
      • Allowed IP ranges or specific IPs.

Diagram Highlights

Public Subnets:

  • EC2 instances hosted in public subnets are protected by security groups.
  • Typical security group rules for public subnets:
    1. Allow inbound HTTP/HTTPS traffic (ports 80 and 443) from the internet.
    2. Allow inbound SSH access (port 22) from a specific IP range for management purposes.
    3. Deny all other inbound traffic by default.

Private Subnets:

  • EC2 instances in private subnets also have security groups.
  • Typical security group rules for private subnets:
    1. Allow inbound traffic only from instances in the public subnet (e.g., application servers).
    2. Deny all other inbound traffic.

Purpose of Security Groups

  1. Enhanced Instance Security:
    • Ensures that only trusted traffic reaches EC2 instances.
  2. Customizable Traffic Control:
    • Tailor rules to specific application requirements.
  3. Simplified Management:
    • Rules can be updated dynamically without disrupting instance operations.

Relevance to Lectures 1 and 2

Lecture 1 Concepts

  1. Cloud Networking Models:

    • The VPC and subnet diagrams illustrate networking within a cloud environment, tying back to deployment models:
      • Public Clouds: Represented by public subnets with internet access.
      • Private Clouds: Represented by private subnets, isolated for secure resources.
  2. EC2 Lifecycle:

    • The EC2 lifecycle diagram connects to foundational cloud computing characteristics:
      • On-Demand Self-Service: Users can start, stop, or terminate instances as needed.
      • Resource Pooling: EC2 instances utilize shared infrastructure dynamically.

Lecture 2 Concepts

  1. AWS EC2 and AMI:

    • Focused diagrams and workflows emphasize core AWS compute services:
      • EC2: Launching and managing virtual servers.
      • AMI: Streamlining instance creation with pre-configured templates.
  2. VPC and Networking:

    • Key AWS networking services are highlighted:
      • Routing: Custom route tables enable secure and efficient traffic management.
      • ACL: Subnet-level control adds an additional security layer.
      • Security Groups: Instance-level firewalls for fine-grained traffic control.
  3. Subnet Configuration:

    • Subnet configurations align with AWS regions and availability zones:
      • Demonstrates the importance of distributing resources across multiple zones for redundancy and fault tolerance.

Summary

  • These diagrams and explanations bridge theoretical cloud computing concepts from Lecture 1 with practical AWS implementations covered in Lecture 2.
  • They emphasize key cloud principles like network isolation, scalability, and security, while showcasing AWS's capabilities in enabling these features.

Autoscaling & Load Balancing

Autoscaling & Load Balancing

Integration

  • ELB: Distributes traffic across instances in multiple subnets.
  • Autoscaling: Automatically adjusts instance count based on load.
  • Subnets: Ensure high availability by using multiple AZs.

AWS Services

  • DynamoDB: NoSQL database for scalable storage.
  • S3: Object storage for data backup and archival.
  • CloudWatch: Monitoring and alerting service.

Storage Types Overview

Storage Types Overview

Comparison

Storage Type Use Case Access Type Durability
S3 Backup, archival Object 99.999999999%
Glacier Long-term archival Object High
EBS Persistent instance storage Block High
EFS Shared file systems File High

Block vs. Object Storage

Block vs. Object Storage

Differences

  • Block Storage: EBS, allows incremental updates to files.
  • Object Storage: S3, stores data as objects with metadata.

S3 URL Breakdown

S3 URL Breakdown

Structure

  • Example: https://bucket-name.s3.amazonaws.com/object-key
    • Bucket Name: Unique identifier for your S3 storage.
    • Object Key: Path to the stored object.

CloudFormation Workflow

CloudFormation Workflow

Steps

  1. Write a CloudFormation template.
  2. Upload template to AWS.
  3. Deploy infrastructure as defined in the template.

Load Balancer Target Groups

Load Balancer Target Groups

Traffic Routing

  • ELB sends requests to target groups.
  • Target groups distribute traffic to specific EC2 instances.

Autoscaling & Load Balancing

Autoscaling & Load Balancing

Advanced Autoscaling & Load Balancing

Advanced Autoscaling & Load Balancing

Configuration

  • Multi-zone EC2 instances.
  • ELB distributes traffic evenly across all zones.

About

Cloud Analytics for Data-science Applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published