💡 Ask Tutor

Databases in AWS – RDS, DynamoDB, Aurora

Scalable, Reliable, and Managed Database Services for Every Application

Databases are a core building block of modern applications, and AWS offers fully managed services to support relational, non-relational, and hybrid database workloads. This chapter explores the key AWS database offerings, focusing on Amazon RDS, Amazon DynamoDB, and Amazon Aurora.


🧱 AWS Database Service Landscape

ServiceTypeUse Case
Amazon RDSRelational DBTraditional apps, CMS, ERP
Amazon AuroraRelational DBCloud-optimized, highly available
Amazon DynamoDBNoSQL DBHigh-speed, scalable, serverless
Amazon ElastiCacheIn-memoryCaching, real-time apps
Amazon RedshiftData warehouseAnalytics, reporting, BI
Amazon NeptuneGraph DBRelationship-driven data

📌 In this chapter, we’ll focus on RDS, Aurora, and DynamoDB, the three most used options for developers and businesses.

Section 1: Amazon RDS (Relational Database Service)

🔍 What is RDS?

Amazon RDS is a managed service that makes it easy to set up, operate, and scale relational databases in the cloud.

Supported Engines:

  • MySQL
  • PostgreSQL
  • MariaDB
  • Oracle
  • SQL Server

✅ AWS handles backups, patching, monitoring, scaling, and replication.


⚙️ RDS Architecture Options

FeatureDescription
Single AZOne database in one Availability Zone
Multi-AZPrimary + automatic standby in another AZ
Read ReplicasRead-only replicas for scaling reads
EncryptionEnable at launch with KMS
MonitoringIntegrated with CloudWatch
BackupsAutomated backups (7–35 days retention)

Creating RDS Instance (Console)

  1. Go to RDS → Create database
  2. Choose Standard Create
  3. Engine: e.g., PostgreSQL
  4. DB instance class: e.g., db.t3.micro
  5. Multi-AZ deployment: Enable for production
  6. Set master credentials
  7. Storage: 20 GB GP2
  8. Enable backups, monitoring
  9. Launch

✅ Security & Access

  • Place RDS in private subnet
  • Use security groups to allow access only from app instances
  • Never expose RDS to public internet
  • Enable IAM DB authentication for MySQL and PostgreSQL
  • Use SSL for connections

📊 RDS Pricing Tips

  • Use burstable instances (db.t3) for dev/test
  • Enable storage auto-scaling
  • Disable Multi-AZ for non-critical workloads
  • Use Reserved Instances for long-term production use (up to 70% off)

Section 2: Amazon Aurora – Cloud-Native Relational Database

🔍 What is Amazon Aurora?

Amazon Aurora is a MySQL- and PostgreSQL-compatible relational database built for the cloud.

  • Up to 5x faster than MySQL, 3x faster than PostgreSQL
  • Auto-healing, multi-AZ replication, and serverless option
  • Storage autoscaling from 10 GB up to 128 TB

🚀 Aurora Key Features

FeatureDescription
Aurora ClustersConsists of 1 writer and multiple readers
Aurora ReplicasLow-latency read replicas
Aurora Serverless v2Auto scales instantly based on demand
Global DatabasesMulti-region replication in < 1s
BacktrackRollback database in seconds without restore
Fast CloningClone entire DBs instantly for testing/dev

Aurora vs RDS

FeatureAuroraRDS
Performance3–5x fasterStandard
PricingPer-second billing (serverless)Per-hour instance billing
Auto ScalingYes (storage + compute)Storage only
Multi-AZBuilt-in + 6 replicasOptional standby
CompatibilityMySQL & PostgreSQLMultiple engines

Aurora Use Cases

  • Large-scale web applications
  • SaaS platforms with bursty traffic
  • Global apps needing read/write performance
  • Financial services requiring instant failover

Section 3: Amazon DynamoDB – NoSQL at Any Scale

🔍 What is DynamoDB?

Amazon DynamoDB is a fully managed NoSQL database that offers single-digit millisecond latency at any scale.

  • No servers to manage
  • Automatically scales based on traffic
  • Supports key-value and document data models
  • Built-in replication, encryption, and TTL (Time To Live)

🧱 Core DynamoDB Concepts

TermDescription
TableCollection of items (similar to rows)
ItemSingle data object (like a row)
AttributeField in an item
Primary KeyUnique identifier (partition key or partition + sort key)
ThroughputRead/write capacity (RCU/WCU) or on-demand
GSI/LSISecondary indexes for query flexibility

✅ When to Use DynamoDB

  • High-velocity applications (gaming, IoT, mobile)
  • Shopping carts, session stores
  • Serverless APIs with low-latency needs
  • Multi-region applications

DynamoDB Example (AWS CLI)

Create Table:

Bash
aws dynamodb create-table \
  --table-name Products \
  --attribute-definitions AttributeName=ProductID,AttributeType=S \
  --key-schema AttributeName=ProductID,KeyType=HASH \
  --billing-mode PAY_PER_REQUEST

Put Item:

Bash
aws dynamodb put-item \
  --table-name Products \
  --item '{"ProductID": {"S": "1001"}, "Name": {"S": "Mouse"}}'

DynamoDB Features

FeatureUse
DAX (in-memory cache)10x read speed boost
StreamsTrigger Lambda functions on item changes
Time To Live (TTL)Auto-expire old items
Global TablesMulti-region replication
Fine-Grained Access ControlRow- and column-level IAM rules

Summary Table: RDS vs Aurora vs DynamoDB

FeatureRDSAuroraDynamoDB
TypeRelationalRelationalNoSQL
ScalingManualAuto-scalingFully serverless
PerformanceModerateHigh-performanceUltra-fast
BackupAutomaticAuto + backtrackPoint-in-time restore
Cost ModelPer instanceInstance/serverlessOn-demand/per request
Use CaseTraditional appsScalable web appsHigh-velocity workloads