Study Guide1,050 words

AWS Database Cost-Optimization and Selection Guide

Determining cost-effective AWS database services with appropriate use cases (for example, DynamoDB compared with Amazon RDS, serverless)

AWS Database Cost-Optimization and Selection Guide

This guide focuses on the critical architectural decision of selecting the most cost-effective and high-performing database service for specific AWS workloads, a core pillar of the SAA-C03 exam.

Learning Objectives

After studying this guide, you should be able to:

  • Distinguish between relational (RDS) and non-relational (DynamoDB) use cases based on cost and access patterns.
  • Select the appropriate RDS instance class and storage type (gp3, io1, etc.) for specific performance requirements.
  • Calculate DynamoDB throughput costs using Read Capacity Units (RCUs) and Write Capacity Units (WCUs).
  • Evaluate the cost-benefits of Aurora Serverless vs. Provisioned instances for unpredictable workloads.
  • Identify high-availability (Multi-AZ) vs. read-scaling (Read Replica) configurations and their cost implications.

Key Terms & Glossary

  • ACID Compliance: Atomicity, Consistency, Isolation, Durability. Standard for relational databases (RDS/Aurora) ensuring reliable transactions.
  • NoSQL: Non-relational database (DynamoDB) that allows for a flexible schema and horizontal scaling.
  • Read Capacity Unit (RCU): For DynamoDB, represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB.
  • Write Capacity Unit (WCU): For DynamoDB, represents one write per second for an item up to 1 KB.
  • Multi-AZ: A high-availability feature that provides a synchronous standby instance in a different Availability Zone.
  • Read Replica: An asynchronous copy of the primary database used to offload read traffic; increases cost but improves performance.

The "Big Idea"

In AWS, cost optimization isn't just about picking the cheapest service; it's about matching the database engine to the data access pattern. A "cheap" RDS instance can become incredibly expensive if it requires massive manual scaling or over-provisioned IOPS, whereas a "pricier" Aurora Serverless DB might save thousands by scaling to zero during idle hours. The goal is to minimize "idle capacity" while maintaining required performance and durability.

Formula / Concept Box

ConceptCalculation/RuleCost Impact
DynamoDB RCU$1 RCU = 1 Strongly Consistent Read/sec (up to 4KB)$2x cheaper if using Eventually Consistent reads.
DynamoDB WCU$1 \text{ WCU} = 1 \text{ Write/sec (up to 1KB)}$Large items (>1KB) consume multiple WCUs.
RDS Storagegp3 (General Purpose) vs io1 (Provisioned IOPS)gp3 is usually 20% cheaper than gp2 with higher baseline.
LicensingBYOL (Bring Your Own) vs License IncludedBYOL can reduce AWS costs if you already own Oracle/SQL Server licenses.

Hierarchical Outline

  1. Relational Database Service (RDS)
    • Engines: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.
    • Scaling: Vertical (Instance size) and Horizontal (Read Replicas).
    • Cost Drivers: Instance hours, Storage (GB/month), I/O requests.
  2. Amazon Aurora
    • Architecture: Shared storage layer across 3 AZs.
    • Serverless v2: Scales in fine-grained increments; ideal for dev/test or spikey traffic.
    • Backtrack: Cost-effective point-in-time recovery without full restores (MySQL only).
  3. Amazon DynamoDB
    • Performance: Single-digit millisecond latency at any scale.
    • Capacity Modes: Provisioned (predictable) vs. On-Demand (spikey/unknown).
    • Global Tables: Multi-region replication for global low-latency (higher cost).
  4. Database Migration Service (DMS)
    • Homogeneous: Same engine (e.g., Oracle to Oracle).
    • Heterogeneous: Different engine (e.g., Oracle to Aurora); uses SCT (Schema Conversion Tool).

Visual Anchors

Database Selection Decision Tree

Loading Diagram...

Multi-AZ vs. Read Replica Architecture

\begin{tikzpicture}[node distance=2cm, every node/.style={rectangle, draw, minimum width=2.5cm, minimum height=1cm, align=center}]

% Multi-AZ side \node (prim) {Primary DB$AZ-A)}; \node (standby) [right of=prim, xshift=2cm] {Standby DB$AZ-B)}; \draw[<->, thick] (prim) -- node[above] {\small Synchronous} (standby); \node[draw=none, fill=none, below of=prim, yshift=1cm] {\textbf{High Availability}};

% Read Replica side \node (master) [below of=prim, yshift=-1cm] {Master DB$AZ-A)}; \node (replica) [right of=master, xshift=2cm] {Read Replica$AZ-B)}; \draw[->, thick, dashed] (master) -- node[above] {\small Asynchronous} (replica); \node[draw=none, fill=none, below of=master, yshift=1cm] {\textbf{Read Scaling}};

\end{tikzpicture}

Definition-Example Pairs

  • Relational Database (SQL)
    • Definition: A database that stores data in tables with predefined schemas and enforces relationships.
    • Example: An ERP system for a manufacturing company where orders, customers, and inventory must maintain strict referential integrity.
  • Non-Relational Database (NoSQL)
    • Definition: A database that stores data in flexible formats (key-value, document) and scales horizontally.
    • Example: A mobile gaming leaderboard that handles millions of small, rapid updates per second with no complex joins required.
  • Aurora Serverless
    • Definition: An on-demand, auto-scaling configuration for Amazon Aurora.
    • Example: A university's student portal that sees massive traffic during registration week but is virtually idle during summer break.

Worked Examples

Example 1: Calculating DynamoDB Throughput Cost

Scenario: An application performs 100 Strongly Consistent Reads per second. Each item is 10 KB.

  1. Calculate RCU for one item: 10 KB/4 KB per RCU=2.510\text{ KB} / 4\text{ KB per RCU} = 2.5. We must round up to 3 RCU per item.
  2. Calculate Total RCU: $100 items/sec \times 3 RCU/item = \mathbf{300 RCU}$.
  3. Cost Optimization: If we switched to Eventually Consistent reads, we would only need 150 RCU ($300 / 2$), cutting the throughput cost in half.

Example 2: RDS Storage Choice

Scenario: A database requires 10,000 IOPS and 1 TB of storage.

  • Option A (gp3): Charges for 1 TB + 7,000 extra IOPS (gp3 provides 3,000 free). This is generally the most cost-effective for medium IOPS needs.
  • Option B (io1): Charges for 1 TB + 10,000 Provisioned IOPS. This is much more expensive but provides lower latency and higher consistency for heavy enterprise workloads.

Checkpoint Questions

  1. Which RDS feature should you use to increase the performance of a read-heavy application without changing the instance size?
  2. You have a legacy Oracle database and want to move it to Amazon Aurora PostgreSQL. Which tool helps you convert the database schema?
  3. True or False: A Multi-AZ standby instance can be used to serve read queries to offload the primary instance.
  4. A startup has an application with unpredictable traffic that completely stops at night. Which database option provides the most cost-savings?
  5. How many WCUs are required to write 10 items per second, where each item is 2.5 KB?
Click to see Answers
  1. Read Replicas.
  2. AWS Schema Conversion Tool (SCT).
  3. False (Only Read Replicas can be read from; Multi-AZ is for failover only).
  4. Aurora Serverless (it can scale to zero/minimum capacity).
  5. 30 WCUs ($2.5 KBroundsupto$3 WCU per item×10 items=30 rounds up to $3 \text{ WCU per item} \times 10 \text{ items} = 30).

Ready to study AWS Certified Solutions Architect - Associate (SAA-C03)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free