Reading20 min read·Module 4

Database Engine Selection

Key concepts

  • RDS vs Aurora costs

  • Open source vs commercial

  • License included vs BYOL

  • Multi-AZ cost impact

  • Read replica costs

Overview

Selecting the right database engine is one of the most important cost optimization decisions in AWS architecture. The choice affects not only the base instance cost but also licensing fees, Multi-AZ deployment costs, read replica pricing, and long-term operational expenses. Understanding the cost implications of each engine helps you design cost-effective database solutions.

Engine Selection Impact

Database engine selection can result in cost differences of up to 80% for the same instance size. Open-source engines (MySQL, PostgreSQL, MariaDB) are significantly cheaper than commercial engines (Oracle, SQL Server). Aurora offers premium performance but at a higher price point than standard RDS. Always match the engine to your workload requirements and budget constraints.

Exam Tip

When exam questions ask about cost-effective database solutions, open-source engines (MySQL, PostgreSQL, MariaDB) are typically the answer unless specific Oracle or SQL Server features are required. Aurora is the answer when high performance AND cost optimization are both required.

Key Concepts

Database Engine Cost Hierarchy

Database engine cost comparison showing relative pricing
Figure 1: Database Engine Cost Hierarchy

Open-Source Engines

MySQL, PostgreSQL, MariaDB

  • Lowest cost tier in RDS
  • No licensing fees included
  • Similar pricing across all three engines
  • PostgreSQL slightly higher for larger instances
  • Best for: Cost-conscious workloads, web applications, general-purpose databases

Typical On-Demand Pricing (db.r5.xlarge):

  • MySQL: ~$0.48/hour
  • PostgreSQL: ~$0.48/hour
  • MariaDB: ~$0.48/hour

Commercial Engines

Oracle and SQL Server

  • Highest cost tier in RDS
  • License cost included in instance price
  • Can be 80%+ more expensive than open-source
  • BYOL option available to reduce costs
  • Best for: Applications requiring specific Oracle/SQL Server features

Typical On-Demand Pricing (db.r5.xlarge):

  • SQL Server Standard: ~$2.50/hour
  • Oracle Standard: ~$1.50/hour (License Included)
  • Oracle BYOL: ~$0.48/hour (same as open-source)

Amazon Aurora

Aurora MySQL and Aurora PostgreSQL

  • 10-20% higher than standard RDS MySQL/PostgreSQL
  • Superior performance (5x MySQL, 3x PostgreSQL throughput)
  • Built-in high availability (Multi-AZ by default)
  • Storage charged per GB-month plus I/O operations
  • Best for: High-performance OLTP, enterprise workloads

Cost Components:

  • Instance hours (compute)
  • Storage (per GB-month)
  • I/O requests (per million)
  • Backup storage (beyond free tier)

RDS vs Aurora Cost Comparison

RDS vs Aurora Cost Factors

FactorStandard RDSAurora
Instance CostBase price for engine10-20% higher than RDS
StorageProvisioned (gp2/gp3/io1)Pay per GB used (auto-scaling)
I/O CostsIncluded in storageCharged per million I/Os
Multi-AZ2x cost (separate standby)Included (replicated storage)
Read ReplicasFull instance cost eachShare storage (lower cost)
Failover Time60-120 secondsUsually < 30 seconds
Best ForPredictable, steady workloadsHigh-performance, variable workloads

License Models

License Included vs BYOL comparison
Figure 2: Database Licensing Options

License Included

License Included Model

  • License cost bundled into hourly rate
  • No license management required
  • Higher hourly cost but simpler
  • Available for: Oracle, SQL Server

When to Use:

  • No existing licenses
  • Want simplified management
  • Short-term or variable workloads
  • Don't want to track license compliance

Bring Your Own License (BYOL)

BYOL Model

  • Use existing Oracle licenses on RDS
  • Reduces cost to open-source levels
  • Requires Oracle License Mobility
  • Must track license compliance yourself

When to Use:

  • Have unused Oracle licenses
  • Enterprise Agreement with Oracle
  • Long-term, stable workloads
  • Cost reduction is priority

Free Tier Available:

  • Oracle BYOL: db.t3.micro eligible
  • SQL Server Express: db.t2.micro eligible

Multi-AZ Cost Impact

Multi-AZ Cost Comparison by Engine

EngineSingle-AZMulti-AZCost Increase
MySQL$0.48/hr$0.96/hr2x (100%)
PostgreSQL$0.48/hr$0.96/hr2x (100%)
SQL Server$2.50/hr$5.00/hr2x (100%)
Aurora$0.58/hrBuilt-in0% (included)
Oracle (License Included)$1.50/hr$3.00/hr2x (100%)
Aurora Multi-AZ Advantage

Aurora includes Multi-AZ replication by default at no extra compute cost. Data is automatically replicated across three Availability Zones. For standard RDS engines, enabling Multi-AZ doubles your instance costs.

Read Replica Costs

Read Replica Pricing

Standard RDS Read Replicas:

  • Billed as separate DB instances
  • Same price as primary instance (if same size)
  • No data transfer charges within same Region
  • Cross-Region replicas: $0.02/GB data transfer

Aurora Read Replicas:

  • Share underlying storage with primary
  • Only pay for compute (instance hours)
  • Storage not duplicated = significant savings
  • Up to 15 replicas with millisecond lag

Read Replica Limits

EngineMax ReplicasReplication LagCross-Region
Aurora MySQL15MillisecondsYes
Aurora PostgreSQL15MillisecondsYes
MySQL15Seconds to minutesYes
PostgreSQL15Seconds to minutesYes
MariaDB15Seconds to minutesYes
SQL Server15Seconds to minutesYes
Oracle5Seconds to minutesYes

Engine Selection Decision Tree

Decision tree for selecting the right database engine
Figure 3: Database Engine Selection Decision Tree

Best Practices

Cost Optimization Strategies

  1. Start with Open-Source: Default to MySQL, PostgreSQL, or MariaDB unless specific features require commercial engines

  2. Consider Aurora for High Performance: When you need enterprise-grade performance, Aurora often provides better price-performance than scaling up standard RDS

  3. Use BYOL When Possible: If you have existing Oracle licenses, BYOL reduces costs to open-source levels

  4. Right-Size Before Multi-AZ: Enable Multi-AZ only for production workloads requiring high availability—it doubles costs for standard RDS

  5. Leverage Reserved Instances: For stable workloads, Reserved Instances offer up to 66% savings on all engines

  6. Evaluate Aurora vs Scaled RDS: Sometimes a smaller Aurora instance outperforms a larger RDS instance at lower cost

Migration Considerations

  • Oracle to PostgreSQL: AWS Schema Conversion Tool (SCT) and DMS can help migrate
  • SQL Server to MySQL/PostgreSQL: Significant application changes may be required
  • MySQL to Aurora MySQL: Minimal changes, significant performance improvement
  • PostgreSQL to Aurora PostgreSQL: Minimal changes, significant performance improvement

Common Exam Scenarios

Database Engine Selection Scenarios

ScenarioRecommended EngineRationale
Cost-effective web application databaseAurora MySQL or RDS MySQLOpen-source, low cost, widely supported
Enterprise ERP requiring OracleRDS Oracle with BYOLUse existing licenses to minimize cost
High-performance read-heavy workloadAurora with Read ReplicasShared storage reduces replica costs
Development/test environmentRDS MySQL or PostgreSQLLowest cost, no Multi-AZ needed
Mission-critical financial systemAurora PostgreSQL Multi-AZHigh availability built-in
Legacy .NET applicationRDS SQL ServerRequired for SQL Server compatibility
Regulatory requirement for OracleRDS Oracle License IncludedCompliance met with managed service
Variable traffic e-commerce siteAurora Serverless v2Scales automatically, pay for use

Common Pitfalls

Defaulting to Commercial Engines

Choosing Oracle or SQL Server without verifying the need adds 80%+ to database costs. Always validate that Oracle/SQL Server-specific features are truly required before selecting commercial engines.

Ignoring Aurora for Cost Optimization

While Aurora has higher per-instance costs, its shared storage model, built-in Multi-AZ, and efficient read replicas often result in lower total cost of ownership for enterprise workloads.

Over-Using Multi-AZ

Enabling Multi-AZ on all databases doubles costs for standard RDS engines. Reserve Multi-AZ for production workloads where high availability is critical. Development and test environments rarely need it.

Oversizing Read Replicas

Read replicas don't need to match the primary instance size. Size them based on actual read traffic requirements, which are often lower than write traffic needs.

Not Considering Total Cost of Ownership

Instance cost is just one factor. Consider storage, I/O, data transfer, backup storage, and operational overhead when comparing engines. Aurora's I/O charges can add up for I/O-intensive workloads.

Quick Reference

Pricing Summary (db.r5.xlarge, US East, On-Demand)

EngineSingle-AZ ($/hr)Multi-AZ ($/hr)Annual Cost (Single-AZ)
MySQL$0.48$0.96~$4,200
PostgreSQL$0.48$0.96~$4,200
MariaDB$0.48$0.96~$4,200
Aurora MySQL$0.58$0.58~$5,100
Oracle (LI)$1.50$3.00~$13,140
Oracle (BYOL)$0.48$0.96~$4,200
SQL Server SE$2.50$5.00~$21,900

Reserved Instance Savings

CommitmentPayment OptionSavings
1 YearNo Upfront~31%
1 YearPartial Upfront~38%
1 YearAll Upfront~42%
3 YearNo Upfront~43%
3 YearPartial Upfront~56%
3 YearAll Upfront~66%

Essential CLI Commands

# List available RDS engine versions
aws rds describe-db-engine-versions --engine mysql

# Get pricing information (requires pricing API)
aws pricing get-products --service-code AmazonRDS

# Describe DB instances with cost-relevant info
aws rds describe-db-instances \
    --query "DBInstances[*].[DBInstanceIdentifier,Engine,DBInstanceClass,MultiAZ]"

Test Your Knowledge

Q

A company wants to migrate from an on-premises Oracle database to AWS but needs to minimize costs. They have unused Oracle licenses with Software Assurance. Which approach is most cost-effective?

ARDS Oracle with License Included
BRDS Oracle with Bring Your Own License (BYOL)
CAurora PostgreSQL after schema conversion
DEC2 with self-managed Oracle
Q

A solutions architect needs to choose a database for a new web application. The requirements are: lowest possible cost, high availability, and MySQL compatibility. Which option should they choose?

ARDS MySQL with Multi-AZ
BAurora MySQL
CRDS MySQL Single-AZ with Read Replica
DAurora Serverless v2
Q

An organization is evaluating database options and needs read replicas for a read-heavy workload. Which statement about read replica costs is correct?

AAurora read replicas cost the same as the primary instance
BRDS read replicas share storage with the primary instance
CAurora read replicas share storage, reducing overall costs
DCross-region read replicas have no data transfer charges
Q

A company is running RDS SQL Server Standard Edition and wants to reduce database costs by 50% or more. Which approach would achieve this goal?

AEnable Multi-AZ deployment for better efficiency
BMigrate to Aurora PostgreSQL using AWS DMS and SCT
CSwitch to RDS SQL Server Express Edition
DUse Reserved Instances with 3-year All Upfront payment

Further Reading

Related services

RDSAurora