Network Storage and Data Lifecycle

Amazon EFS (Elastic File System)

Amazon EFS (Elastic File System) – Architecture
EFS Performance Settings

Throughput Modes

  1. Bursting (Default)
    • Throughput increases as the file system grows in size.
    • Uses a burst credit model similar to GP2 EBS volumes.
  2. Enhanced Throughput Modes
    • Elastic Throughput
      • Automatically adjusts based on workload demand.
      • Suitable for unpredictable or variable access patterns.
    • Provisioned Throughput
      • Allows specifying throughput independently of storage size.
      • Useful for consistent, high-performance requirements.

Performance Modes

  1. General Purpose (Default)
    • Optimized for low latency.
    • Suitable for web applications, CMS platforms, and general file sharing.
  2. Max I/O
    • Designed for high throughput and parallel workloads.
    • Trades lower latency for increased scalability.
    • Common in analytics or large-scale processing workloads.

EFS Storage Settings

Storage Classes

  1. Standard
    • Intended for frequently accessed data.
  2. Infrequent Access (IA)
    • Lower cost for less frequently used files.
  3. Archive
    • Lowest-cost tier for rarely accessed data.

Additional EFS Features

DEMO: Using EFS with EC2 WordPress Instances

Demo: Implementing a Basic EFS

Configuring an EC2 Instance to Use EFS

  1. df -k
    • Displays all currently mounted file systems and available disk space.
    • Initially confirms that no EFS file system is mounted.
  2. sudo mkdir -p /efs/wp-content
    • Creates the directory structure for mounting EFS.
    • The -p option ensures intermediate directories are created if needed.
  3. sudo dnf -y install amazon-efs-utils
    • Installs required utilities for interacting with EFS.
    • The -y flag automatically approves installation prompts.
  4. sudo nano /etc/fstab
    • Opens the file that defines file systems to mount at boot.
    • Add the following entry at the end: <file-system-id>:/ /efs/wp-content efs _netdev,tls,iam 0 0
    • Replace <file-system-id> with the actual EFS ID.
  5. sudo mount /efs/wp-content
    • Mounts the file system based on the fstab configuration.
  6. df -k
    • Verifies that the EFS file system is now mounted.
WordPress Architecture with EFS

AWS Backup 101

AWS Backup – Basic Concepts
AWS Backup – Key Components

Backup Plans

Backup Resources

Backup Vault

On-Demand Backups

Point-In-Time Recovery (PITR)

Key Takeaways

SQL Databases & RDS

Database Models

Databases – Basic Concepts

Core Concepts

Relational Databases (SQL / RDBMS)
SQL Databases: Row vs Column Design

Row-Based Databases (OLTP)

Column-Based Databases (OLAP)

Non-Relational (NoSQL) Databases

Key-Value Stores

Wide Column Stores

Document Databases

Graph Databases

Database Models – Summary
ModelStructureTypical Use Cases
Relational (SQL)Fixed schema, tables with rows and columnsStructured data with defined relationships
Row-based (OLTP)Rows stored togetherTransactional systems
Column-based (OLAP)Columns stored togetherAnalytics and reporting
Key-valueSimple key-value pairsCaching, simple lookups
Wide columnFlexible attributes with structured keysLarge-scale applications
DocumentJSON/XML documentsCMS, user data, catalogs
GraphNodes and relationshipsRelationship-driven systems

Databases: ACID vs BASE

CAP Theorem
  1. Consistency (C)
    • Every read returns the most recent write, or an error if that’s not possible.
    • If you write a new value and read immediately, you either get the new value or an error.
  2. Availability (A)
    • Every request receives a response, but it may not be the latest data.
  3. Partition Tolerance (P)
    • DB continues to operate even if network partitions or node failures occur.
    • Messages between nodes may fail, but the system keeps running.

Trade-off Example:

ACID Transaction Model (SQL / RDBMS)
  1. Atomic
    • Transaction succeeds entirely or not at all.
    • $10 transfer example: money must leave Account A and arrive in Account B.
  2. Consistent
    • DB moves from one valid state to another.
    • Invalid states are never allowed.
  3. Isolated
    • Parallel transactions do not interfere; end result is as if transactions were sequential.
  4. Durable
    • Committed transactions persist even after crashes.
    • Once the DB reports success, data is stored safely on non-volatile memory.
BASE Transaction Model (NoSQL / DynamoDB)
  1. Basically Available
    • R/W operations available as much as possible, without strict consistency guarantees.
  2. Soft State
    • Consistency is not enforced in DB; handled by the application.
    • Data returned may not be the latest.
  3. Eventually Consistent
    • Given enough time, the DB will converge to the latest state.
    • Immediate consistency is not guaranteed by default.
Exam Power Notes (AWS)

Databases in EC2

Monolith vs DB-Split Architecture
Why Databases on EC2 Are Bad Practice

1. Administrative Overhead

2. Single Availability Zone Limitation

3. Fewer Features Compared to Managed Services

4. Poor Scalability and No Serverless Options

When a Database on EC2 Might Be Justified

These scenarios should be carefully validated:

1. OS-Level Access Required

2. Advanced Database Customization

3. AWS Does Not Support the Requirement

4. Business Decision

Key AWS Exam Takeaways

Amazon RDS (Relational Database Service) 101

Amazon RDS – Key Concepts
RDS Architecture
RDS Billing Overview
  1. Instance fee:
    • Billed hourly (per-second granularity)
    • Cost depends on instance size & type
  2. Multi-AZ mode: extra cost (extra instance + storage)
  3. Storage fee: per GB/month
    • Storage type affects price (e.g., Provisioned IOPS more expensive)
  4. Data transfer fee: per GB in/out of instance
    • Free within the same region
  5. Backups & snapshots: per GB/month
    • Free backup storage = size of your DB storage
  6. Licensing fee: if using commercial DB engines

DEMO: Migration of WordPress DB to a Different DB Tier

Migration of MariaDB to a Different EC2 Instance
Migration of MariaDB to RDS (Free Tier)

Part 1: Creation of an RDS Instance

Part 2: Migration from EC2 DB Instance to RDS

RDS Multi-AZ Deployments

RDS Multi-AZ – Instance Deployment
RDS Multi-AZ – Cluster Deployment

RDS Snapshots, Automatic Backups, and Restore

Backing Up Data in RDS

RDS Manual Snapshots

RDS Automated Backups

Restoring Data in RDS

RDS Read-Replicas (RRs)

RDS Read-Replicas (RRs) – Architecture
Promotion of RDS Read-Replicas & Disaster Recovery

DEMO: RDS Multi-AZ & Snapshot Restore

When taking a snapshot, it is a good idea to include the DB engine and DB version in the snapshot name. Multi-AZ deployment and creation of a standby replica are recommended for PROD usage:

Backup windows are defined when creating the instance and can be adjusted later in the instance settings. When creating a standby replica (Multi-AZ), it can be created immediately or in the next backup window:

An RDS instance can be rebooted with failover if a standby replica is configured:

After restoring a snapshot, the new instance will take some time to become available.

RDS Data Security

RDS Encryption

RDS Encryption in Transit

RDS Encryption at Rest

  1. EBS Volume Encryption with KMS
    • Default option, handled by the host and underlying EBS storage.
    • DEKs generated from AWS-managed or customer-managed KEKs/CMKs.
    • DEKs are loaded on hosts as required for encryption/decryption operations.
    • Cannot be removed once enabled.
    • Transparent to the DB engine; DB sees unencrypted data.
  2. Transparent Data Encryption (TDE)
    • Native DB engine encryption (supported by RDS MSSQL and RDS Oracle).
    • Data encrypted by DB engine before being written to disk.
    • RDS Oracle can integrate with AWS CloudHSM, giving stronger key controls.
    • CloudHSM is secured by the customer, keeping AWS out of the trust chain.

RDS Authentication and Authorization

Local DB Users

IAM Authentication for RDS

RDS Custom

RDS Custom – Key Facts

Amazon Aurora 101

Amazon Aurora – Overview
Aurora Provisioned Architecture

Cluster (DB Instances)

Storage (Cluster Volume)

Access (Endpoints)

Aurora Billing (Provisioned)
Aurora Features

Aurora Global Database

Aurora Global DB – Overview

Replication Architecture

Benefits

  1. Cross-region disaster recovery & business continuity
    • Failover possible if primary region fails.
    • Very low downtime (low RTO) and minimal data loss (low RPO).
  2. Global read scaling
    • Secondary regions serve read traffic → reduces latency internationally.
    • Ideal for applications with global users needing fast reads.

Aurora Multi-Master Writes

Aurora Single-Master Mode (Default)

Key point: Single-Master clusters have a single write target; reads can be scaled via replicas.

Aurora Multi-Master Mode

Key point: Multi-Master allows multiple writers simultaneously, enabling high availability and potential FT applications, but app complexity increases.

Quick comparison table:

FeatureSingle-MasterMulti-Master
Write Instances11–16
Read ScalingReader replicasApp handles reads
FailoverReplica promoted, cluster endpoint updatedInstant via app, no promotion needed
App ComplexityLowHigh (must manage reads/writes & failover)
Use CaseStandard HAHigh availability, FT applications

Aurora Serverless

Aurora Serverless – Key Concepts
Aurora Serverless v1 – Architecture
Aurora Serverless – Benefits
  1. Simpler management model with reduced administrative overhead for database capacity
  2. Automatic and seamless scaling of compute and memory resources without interrupting connections
  3. Cost efficiency through usage-based pricing

Aurora Serverless – Use Cases

Demo: Migrating WordPress DB to Aurora Serverless v1

RDS Proxy

Database Proxies – Overview
RDS Proxy – Architecture
Good-Fit Scenarios for RDS Proxy

RDS & Aurora – Summary Table

AWS Relational DB modelArchitecture & AZ coverageStorageScalability & Failover
RDS Single-AZSingle database instance deployed in one Availability ZoneEBS– No support for scaling

AWS Database Migration Service (DMS) & AWS Schema Conversion Tool (SCT)

Database Migrations
AWS Database Migration Service (DMS) – Architecture
AWS Schema Conversion Tool (SCT)
Large Database Migrations with DMS and AWS Snowball