Difference between revisions of "IT-Exam-AWS"

From wiki.samerhijazi.net
Jump to navigation Jump to search
(XXX)
(Amazon DynamoDB (NoSQL,MongoDB, CouchDB, DynomaDB))
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Core AWS Services=
 
=Core AWS Services=
* EC2 – Instances, types, autoscaling
+
* EC2 (Elastic Compute Cloud): Virtual servers in the cloud.
* S3 Storage classes, performance, hosting static websites
+
* S3 (Simple Storage Service): Object storage for any type of file (images, backups, videos, logs).
* ELB (Elastic Load Balancer) – For distributing traffic
+
* ELB (Elastic Load Balancer): Distributes traffic across multiple EC2s or containers.
* RDS & DynamoDB – When to use what (relational vs NoSQL)
+
* Database RDS (Relational Database Service): Managed relational database (e.g., MySQL, PostgreSQL).
* Lambda For serverless scenarios
+
* Database DynamoDB: Managed Serverless  and NoSQL database (key-value or document-based) to handles fast session data.
* CloudFront CDN to reduce latency
+
* Lambda: Run code without servers. For serverless scenarios.
* IAM (roles, policies, least privilege)
+
* CloudFront: AWS’s Content Delivery Network (CDN) to reduce latency (edge server).
 +
* IAM (Identity and Access Management): Controls who can do what in your AWS account. (roles, policies, least privilege).
  
 
=Architecture Best Practices=
 
=Architecture Best Practices=
Line 31: Line 32:
 
* You need complex reporting or analytics using joins, aggregations, etc.
 
* You need complex reporting or analytics using joins, aggregations, etc.
  
==Amazon DynamoDB (NoSQL)==
+
==Amazon DynamoDB (NoSQL,MongoDB, CouchDB, DynamoDB)==
 
* You need high-speed reads/writes at any scale
 
* You need high-speed reads/writes at any scale
 
* You don’t need complex relationships (no joins)
 
* You don’t need complex relationships (no joins)
Line 39: Line 40:
 
* Prioritizes performance, scalability, availability over strict consistency
 
* Prioritizes performance, scalability, availability over strict consistency
  
=XXX=
+
=Techo=
 
== ACID (Atomicity, Consistency, Isolation, Durability) transactions==
 
== ACID (Atomicity, Consistency, Isolation, Durability) transactions==
 
* A (Atomicity): A transaction is all or nothing — if one part fails, the entire thing rolls back.
 
* A (Atomicity): A transaction is all or nothing — if one part fails, the entire thing rolls back.
Line 69: Line 70:
 
** Dynamic Content Optimization
 
** Dynamic Content Optimization
 
** Global Load Balancing
 
** Global Load Balancing
 +
==Elastic Load Balancer==
 +
* An Elastic Load Balancer (ELB) automatically distributes incoming traffic across multiple targets (like EC2 instances, containers, or IPs) in one or more Availability Zones (AZs).
 +
* Goal:
 +
** Prevent any single server from getting overwhelmed,
 +
** Ensure high availability,
 +
** And handle traffic dynamically as demand changes.
 +
==S3 (scalable object storage service)==
 +
* A scalable object storage service used to store and retrieve any amount of data — like images, videos, backups, logs, documents, etc.
 +
* Storage Classes:
 +
** S3 Standard: Frequently accessed data
 +
** S3 Intelligent-Tiering: Automatic tiering based on access patterns
 +
** S3 Standard-IA: Infrequent Access (e.g., backups)
 +
** S3 One Zone-IA: Infrequent access, one AZ only
 +
** S3 Glacier/Deep Archive: Archival, long-term storage (e.g., compliance)

Latest revision as of 13:23, 14 April 2025

Core AWS Services

  • EC2 (Elastic Compute Cloud): Virtual servers in the cloud.
  • S3 (Simple Storage Service): Object storage for any type of file (images, backups, videos, logs).
  • ELB (Elastic Load Balancer): Distributes traffic across multiple EC2s or containers.
  • Database RDS (Relational Database Service): Managed relational database (e.g., MySQL, PostgreSQL).
  • Database DynamoDB: Managed Serverless and NoSQL database (key-value or document-based) to handles fast session data.
  • Lambda: Run code without servers. For serverless scenarios.
  • CloudFront: AWS’s Content Delivery Network (CDN) to reduce latency (edge server).
  • IAM (Identity and Access Management): Controls who can do what in your AWS account. (roles, policies, least privilege).

Architecture Best Practices

  • Operational Excellence
  • Security
  • Reliability
  • Performance Efficiency
  • Cost Optimization
  • Sustainability (recent addition)

Low-Latency Architecture

  • Use CloudFront for global distribution
  • Place backend services in multiple Availability Zones
  • Use Auto Scaling for EC2 or Lambda
  • Use Elasticache for caching (Redis/Memcached)
  • Choose regions close to the end users
  • Use Global Accelerator if needed

Databases

Amazon RDS (Relational Database Service) & Aurora

  • You need structured data with relationships (foreign keys, joins).
  • Your application depends on SQL queries (PostgreSQL, MySQL, MariaDB, SQL Server, Oracle).
  • You require ACID transactions (Atomicity, Consistency, Isolation, Durability).
  • You need complex reporting or analytics using joins, aggregations, etc.

Amazon DynamoDB (NoSQL,MongoDB, CouchDB, DynamoDB)

  • You need high-speed reads/writes at any scale
  • You don’t need complex relationships (no joins)
  • Your data is semi-structured or unstructured (Schema-less or flexible schema)
  • You expect massive scale (e.g., millions of users, IoT, gaming)
  • High scalability: Designed to scale horizontally across servers
  • Prioritizes performance, scalability, availability over strict consistency

Techo

ACID (Atomicity, Consistency, Isolation, Durability) transactions

  • A (Atomicity): A transaction is all or nothing — if one part fails, the entire thing rolls back.
  • C (Consistency): The database must move from one valid state to another — rules and constraints are respected.
  • I (Isolation): Transactions don't interfere with each other — even when run at the same time.
  • D (Durability): Once a transaction is committed, the data is permanently saved, even if the system crashes.

ACID-Example

Let’s say you’re transferring $100 from Account A to Account B.

  • Subtract $100 from Account A
  • Add $100 to Account B

For it to be an ACID-compliant transaction, both steps must happen together, or neither should.

Here’s how each ACID property applies:

  • Atomicity: If step 1 succeeds but step 2 fails — rollback step 1.
  • Consistency: The total balance in the system must remain the same.
  • Isolation: Another transfer happening at the same time won't mess this one up.
  • Durability: Even if the server crashes right after the transfer — the change will persist.

In AWS Context:

  • RDS: Fully supports ACID across all supported engines.
  • DynamoDB: Supports transactional APIs, but not as flexible as RDS for complex multi-table transactions.

CDN (Content Delivery Network)

  • CloudFront is AWS’s CDN
  • is a geographically distributed network of servers that cache and deliver content to users based on their location.
  • Instead of all users fetching content from a single origin server (e.g., in Frankfurt), the CDN brings the content closer to the user
    • Edge Locations
    • Caching
    • Dynamic Content Optimization
    • Global Load Balancing

Elastic Load Balancer

  • An Elastic Load Balancer (ELB) automatically distributes incoming traffic across multiple targets (like EC2 instances, containers, or IPs) in one or more Availability Zones (AZs).
  • Goal:
    • Prevent any single server from getting overwhelmed,
    • Ensure high availability,
    • And handle traffic dynamically as demand changes.

S3 (scalable object storage service)

  • A scalable object storage service used to store and retrieve any amount of data — like images, videos, backups, logs, documents, etc.
  • Storage Classes:
    • S3 Standard: Frequently accessed data
    • S3 Intelligent-Tiering: Automatic tiering based on access patterns
    • S3 Standard-IA: Infrequent Access (e.g., backups)
    • S3 One Zone-IA: Infrequent access, one AZ only
    • S3 Glacier/Deep Archive: Archival, long-term storage (e.g., compliance)