AWS Database Selection: RDS, DynamoDB and Aurora Compared for Different Workloads

Choosing between RDS, DynamoDB, and Aurora is one of those decisions that is easy to get wrong early and expensive to fix later. I have seen teams default to RDS because it feels familiar, then hit a wall when their workload needed single-digit millisecond reads at 50k TPS. I have also seen teams force everything into DynamoDB and end up rebuilding relational joins in application code. Each of these services solves a different set of constraints around consistency, scaling, operational overhead, and cost. This article breaks down how I evaluate them for real production workloads, what the operational trade-offs look like after six months in production, and how to automate the choice so you are not manually babysitting failovers at 2 AM.

When RDS Is Still the Right Answer for Relational Workloads

In my experience, RDS remains the best fit when you have a traditional relational data model, need strong ACID guarantees across multiple tables, and your scaling requirements are predictable and vertical-friendly. If you are migrating an existing MySQL or PostgreSQL application from on-premises or EC2, RDS gives you managed patching, automated backups, and Multi-AZ failover without forcing you to rethink your schema. For workloads under ~20k IOPS and where read replicas can handle the read fan-out, RDS is often cheaper and simpler than Aurora.

Where RDS struggles is write scaling. You get one primary writer. Read replicas help with read scaling, but replication lag is real. I have measured 80-150ms lag on a busy PostgreSQL RDS instance with two cross-AZ read replicas under write-heavy OLTP. If your application cannot tolerate stale reads, that lag matters. Aurora handles replication differently, which is why it pulls ahead for write-heavy or high-availability workloads.

Engine Choice and Version Lock-In Considerations

RDS supports MySQL, PostgreSQL, MariaDB, Oracle, and SQL Server. In practice, I see PostgreSQL and MySQL dominate new builds. PostgreSQL on RDS is my default for anything needing JSONB, GIS via PostGIS, or complex constraints. MySQL makes sense when you have an existing codebase tuned for it. One operational detail teams underestimate: engine minor version upgrades. RDS allows you to enable auto minor version upgrades, but I always disable that for production and manage upgrades through maintenance windows with Terraform. An automatic upgrade that restarts your primary during business hours will cause an outage you could have scheduled.

Parameter groups are another subtlety. If you need to tune max_connections, shared_buffers, or innodb_buffer_pool_size, you will be creating custom DB parameter groups and associating them with your instances. Changes to static parameters require a reboot. Plan for that in your deployment pipeline.

Multi-AZ Failover and Read Replica Topology I Actually Use

For any production RDS deployment, I run Multi-AZ. The failover is not instantaneous. In my tests, unplanned failover for a db.r6g.large PostgreSQL instance takes 60-120 seconds, during which DNS flips the endpoint to the standby. Your application must handle retries and connection draining. I front RDS with RDS Proxy or PgBouncer to absorb connection storms during failover. Without a proxy, a fleet of Lambda functions or containers that all reconnect at once can overwhelm the newly promoted primary with thousands of connections.

For read scaling, I typically deploy two read replicas in different AZs and place them behind a reader endpoint if using Aurora, or use application-level routing for vanilla RDS. For RDS MySQL/PostgreSQL, I use Route 53 weighted routing or client-side load balancing to spread reads. Keep an eye on ReplicaLag in CloudWatch. If it consistently exceeds 200ms, you either need a larger replica instance class or you need to reduce write throughput on the primary. This ties directly into the reliability pillar discussed in AWS Well-Architected Framework: Applying the Five Pillars in Practice, where design for failure includes tested failover paths rather than assuming Multi-AZ is magic.

# RDS PostgreSQL with Multi-AZ and custom parameter group
resource "aws_db_instance" "orders_primary" {
  identifier             = "orders-prod-pg"
  engine                 = "postgres"
  engine_version         = "15.4"
  instance_class         = "db.r6g.large"
  allocated_storage      = 200
  storage_type           = "gp3"
  storage_encrypted      = true
  multi_az               = true
  db_subnet_group_name   = aws_db_subnet_group.private.id
  vpc_security_group_ids = [aws_security_group.db.id]
  parameter_group_name   = aws_db_parameter_group.pg15_custom.name
  backup_retention_period = 7
  performance_insights_enabled = true
  deletion_protection    = true

  # Manage upgrades explicitly, not automatically
  auto_minor_version_upgrade = false
  maintenance_window      = "sun:04:00-sun:05:00"
}

resource "aws_db_parameter_group" "pg15_custom" {
  family = "postgres15"
  name   = "pg15-custom-prod"

  parameter {
    name  = "max_connections"
    value = "500"
  }
  parameter {
    name         = "shared_preload_libraries"
    value        = "pg_stat_statements"
    apply_method = "pending-reboot"
  }
}

DynamoDB for High-Velocity, Partitionable Access Patterns

DynamoDB is not a relational database you can drop in. I treat it as a distributed key-value and document store that gives you predictable performance at any scale, but only if you model your data around your access patterns upfront. If your queries are well-defined, key-based lookups, and you need single-digit millisecond latency at massive throughput without managing servers, DynamoDB is hard to beat. I have run it for session stores, event ledgers, IoT telemetry, and serverless application backends where the read/write pattern was known on day one.

The mistake I see most often is trying to use DynamoDB like PostgreSQL: creating a table with a primary key and then attempting ad-hoc queries with scans and filters. Scans are expensive and slow at scale. Every query should be a GetItem, Query on a key, or a Query on a Global Secondary Index. If you find yourself needing joins, range scans across arbitrary attributes, or complex aggregations, DynamoDB will fight you.

Partition Keys, Sort Keys, and Single-Table Design Trade-offs

Data modeling starts with access patterns. I run a workshop that lists every query as: Get X by Y, Query X where Y = Z sorted by T. Those become your partition key (PK) and sort key (SK) definitions. For example, an orders workload might use PK = CUSTOMER#123 and SK = ORDER#2024-01-15#456. This lets you fetch all orders for a customer with a single Query and paginate efficiently.

Single-table design consolidates multiple entity types into one table using generic PK/SK attributes and GSIs. It reduces RCU/WCU consumption and avoids multiple tables, but it complicates application logic. I only use single-table design when the workload has very high throughput and the access patterns are stable. For most intermediate teams, I recommend starting with one table per entity and adding GSIs as needed. You can always refactor into single-table later, but the inverse refactor is harder. DynamoDB Streams and TTL are features I rely on heavily for event-driven architectures. Streams feed Lambda or Kinesis for audit trails, and TTL automatically expires ephemeral data without manual cleanup jobs. This pairs naturally with Serverless Architecture Patterns: API Gateway, Lambda and Step Functions where DynamoDB is the state layer for functions.

Capacity Modes and Global Tables in Production

You have two capacity modes: Provisioned with Auto Scaling, and On-Demand. On-Demand is excellent for spiky, unpredictable workloads and for new tables where you do not know the traffic shape. I use it during launch and for 30 days to collect CloudWatch metrics on ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits. Once the pattern stabilizes, I switch to Provisioned with Auto Scaling to cut costs by 40-60%. In one e-commerce checkout table, moving from On-Demand to Provisioned with a target utilization of 70% saved roughly $1,800 per month at 15k WCU peak.

Throttling is the signal to watch. DynamoDB will throttle if you exceed your provisioned capacity or if you have a hot partition. Hot partitions happen when one partition key gets disproportionate traffic. I mitigate this by adding a write-sharding suffix to the PK for hot keys, e.g., ORDER#HOT#1 through ORDER#HOT#10 and randomizing writes. Global Tables provide multi-Region active-active replication with eventual consistency and last-writer-wins conflict resolution. I have deployed them for low-latency reads in us-east-1 and eu-west-1, but you must design for conflict handling. If the same item is updated in two Regions simultaneously, one write wins and the other is lost.

# DynamoDB table with on-demand billing, GSI, TTL and stream for event processing
resource "aws_dynamodb_table" "orders" {
  name         = "orders-prod"
  billing_mode = "PAY_PER_REQUEST"
  hash_key     = "pk"
  range_key    = "sk"

  attribute {
    name = "pk"
    type = "S"
  }
  attribute {
    name = "sk"
    type = "S"
  }
  attribute {
    name = "gsi1pk"
    type = "S"
  }
  attribute {
    name = "gsi1sk"
    type = "S"
  }

  global_secondary_index {
    name            = "gsi1"
    hash_key        = "gsi1pk"
    range_key       = "gsi1sk"
    projection_type = "ALL"
  }

  ttl {
    attribute_name = "expiresAt"
    enabled        = true
  }

  stream_enabled   = true
  stream_view_type = "NEW_AND_OLD_IMAGES"
  point_in_time_recovery { enabled = true }

  tags = { Environment = "prod" }
}

Aurora's Distributed Storage and Why It Is Not Just Managed MySQL

Aurora is MySQL and PostgreSQL compatible, but the storage layer is completely different from RDS. Instead of EBS volumes attached to a single instance, Aurora uses a distributed, fault-tolerant storage fleet that replicates data six ways across three Availability Zones. Compute and storage are decoupled. This is why Aurora can scale storage automatically to 128 TiB, replicate to up to 15 low-latency read replicas, and fail over in under 30 seconds in my tests versus 60-120 for RDS.

For DevOps, the practical impact is less storage management and faster clone and restore operations. Aurora's storage auto-scales in 10 GB increments, so you stop capacity planning for disk. The shared storage volume means adding a read replica does not require copying data; it just attaches compute to the same volume, so replica creation takes minutes, not hours. I have used Aurora Global Database to get cross-Region replication with typical lag under a second, which is significantly faster than RDS cross-Region read replicas that use asynchronous binlog replication.

How Aurora Storage Auto-Scaling and Repair Actually Works

Aurora storage is striped across hundreds of storage nodes. When you write, the primary computes redo logs and streams them to storage nodes, which materialize the pages. Quorum writes require 4 of 6 nodes to acknowledge, quorum reads require 3 of 6. If a storage node fails, Aurora repairs the segment in the background without impacting availability. In my experience, this means AZ failures are largely invisible to the database layer. During a simulated AZ loss, the Aurora cluster continued serving writes with a brief 5-10 second pause while the quorum re-established, whereas a standalone RDS instance in that AZ would have required a full failover.

Backtracking is a feature I use for dev and staging clusters. It lets you rewind the database to a point in time without restoring from a snapshot, which takes minutes instead of hours. It is not a replacement for backups but it is invaluable when a bad migration corrupts data and you want to rewind 30 minutes quickly. Note that backtracking adds overhead and is not recommended for high-write production clusters.

Aurora Serverless v2 Versus Provisioned Clusters for Variable Traffic

Aurora Serverless v1 had cold start and scaling limitations that made it unsuitable for many production workloads. Serverless v2 is a different architecture. It scales in fine-grained increments of 0.5 ACU (Aurora Capacity Units) and supports mixed clusters where you have provisioned and serverless instances together. I have used Serverless v2 for spiky API workloads where traffic goes from 200 to 15,000 connections in a minute. It scales from 2 ACUs to 64 ACUs in under 30 seconds without dropping connections when paired with RDS Proxy.

The trade-off is cost predictability. At sustained high utilization, provisioned Aurora is cheaper. I run provisioned Aurora for steady-state OLTP and add Serverless v2 readers for burst reads or for dev environments that sit idle overnight. One pattern that works well is a provisioned writer with two Serverless v2 readers that scale to zero when there is no read traffic. If your workload is containerized and you are already orchestrating scaling at the application layer, review the Cloud Networking: VPC Peering, Transit Gateway and PrivateLink guidance to ensure your VPC, subnet, and PrivateLink setup allows Aurora to scale without hitting ENI or subnet IP exhaustion. For the infrastructure code itself, I follow the patterns in the Terraform Documentation for managing lifecycle and state locking.

# Aurora PostgreSQL Serverless v2 with global database and RDS Proxy
resource "aws_rds_cluster" "aurora_pg" {
  cluster_identifier     = "orders-aurora-prod"
  engine                 = "aurora-postgresql"
  engine_version         = "15.3"
  engine_mode            = "provisioned"
  database_name          = "orders"
  master_username        = "dbadmin"
  master_password        = random_password.db.result
  db_subnet_group_name   = aws_db_subnet_group.private.name
  vpc_security_group_ids = [aws_security_group.db.id]
  storage_encrypted      = true
  backup_retention_period = 7
  preferred_backup_window = "03:00-04:00"
  deletion_protection    = true
}

resource "aws_rds_cluster_instance" "writer" {
  identifier         = "orders-aurora-writer"
  cluster_identifier = aws_rds_cluster.aurora_pg.id
  instance_class     = "db.serverless"
  engine             = aws_rds_cluster.aurora_pg.engine
  engine_version     = aws_rds_cluster.aurora_pg.engine_version

  performance_insights_enabled = true
  monitoring_interval          = 60
}

resource "aws_rds_cluster_instance" "reader" {
  identifier         = "orders-aurora-reader"
  cluster_identifier = aws_rds_cluster.aurora_pg.id
  instance_class     = "db.serverless"
  engine             = aws_rds_cluster.aurora_pg.engine
  engine_version     = aws_rds_cluster.aurora_pg.engine_version
}

resource "aws_db_proxy" "aurora_proxy" {
  name                   = "orders-aurora-proxy"
  engine_family          = "POSTGRESQL"
  role_arn               = aws_iam_role.rds_proxy.arn
  vpc_subnet_ids         = data.aws_subnets.private.ids
  vpc_security_group_ids = [aws_security_group.proxy.id]
  require_tls            = true
  idle_client_timeout    = 600

  auth {
    iam_auth = "REQUIRED"
    auth_scheme = "SECRETS"
    secret_arn = aws_secretsmanager_secret.db_creds.arn
  }
}

Head-to-Head Cost, Latency, and Scaling Boundaries I Use for Selection

Selection comes down to measurable constraints. I ask four questions: What is the data shape and consistency requirement? What is the read/write latency target at p95 and p99? What is the expected scaling profile over 12 months? What operational burden can the team sustain? The answers map directly to a database.

For example, a financial ledger requiring serializable transactions and foreign keys is a poor fit for DynamoDB, regardless of scale. An adtech bidding engine needing 10ms reads at 100k RPS with eventual consistency is a poor fit for RDS. Aurora sits in the middle: it gives you relational semantics with better scalability than RDS, but it is still not horizontally write-scalable. If you need write sharding across multiple writers, you are looking at DynamoDB or a sharded RDS/Aurora approach with application-level routing, which adds significant complexity.

Cost is where assumptions often break. DynamoDB On-Demand looks cheap until you run a workload with high write throughput and frequent GSIs, each of which consumes additional WCUs. Aurora looks expensive per ACU until you factor in not paying for IOPS separately and not over-provisioning storage. RDS is cheapest for steady, moderate workloads but becomes costly when you need large read replica fleets to keep up. I model cost with three months of projected traffic, including backups, data transfer, and I/O, not just instance hours.

Dimension RDS (MySQL/PostgreSQL) Aurora (MySQL/PostgreSQL Compatible) DynamoDB
Scaling Model Vertical scale + up to 5 read replicas, replication lag 80-200ms Storage auto-scales to 128 TiB, up to 15 replicas with <20ms lag, Serverless v2 auto-scales per second Virtually unlimited throughput, auto-scales via On-Demand or Auto Scaling, single-digit ms at any scale
Consistency & Transactions Full ACID, serializable isolation, foreign keys, joins Full ACID, same as RDS, faster crash recovery via distributed storage Eventual or strong consistency per read, ACID transactions within 100 items / 4MB, no joins
Typical p95 Latency 5-15ms cached reads, 10-30ms writes depending on instance class and EBS 3-10ms reads via shared storage, faster replica promotion ~30s failover 1-5ms GetItem/Query with DAX ~1ms, writes 5-10ms, throttling if hot partition
Operational Overhead Manual storage scaling, version upgrades, replica lag monitoring Less storage ops, fast clones/backtrack, still need vacuum and parameter tuning No servers, no patching, focus on data modeling and capacity mode tuning
Best For Lift-and-shift, complex relational workloads under 20k IOPS Cloud-native relational apps needing high availability and burst scaling Serverless, high-velocity key-based workloads with predictable access patterns
Watch Out For Write bottleneck on single primary, connection limits without proxy Higher base cost, Aurora-specific parameter behaviors, I/O costs in v1 Poor fit for ad-hoc analytics, GSI cost amplification, hot keys

Operational Realities: Terraform Automation, Monitoring, and Failover Drills

The database you can provision is not the database you can operate. In my environments, every database is provisioned via Terraform with state locking via S3 and DynamoDB, modules versioned in Git, and applies gated through CI. I never create databases via the console in production. The reason is drift. A manual change to a parameter group or security group will not be reflected in code and will cause a surprise during the next apply. As described in the Terraform Documentation, using remote state and workspaces keeps environment parity between staging and production.

I also tag all database resources by environment, team, and data classification, and I enforce deletion protection and final snapshot settings via policy as code with OPA or Checkov. A missing deletion_protection = true in a module has caused more than one outage in my career when someone ran terraform destroy against the wrong workspace.

Metrics That Actually Predict Outages

For RDS and Aurora, I alert on CPUUtilization, FreeableMemory, SwapUsage, ReadLatency and WriteLatency, DatabaseConnections, and ReplicaLag. For Aurora, I add AuroraVolumeBytesLeftTotal even though storage auto-scales, because a runaway job can still grow storage by terabytes in hours. For DynamoDB, I alert on ThrottledRequests, ConsumedReadCapacityUnits versus ProvisionedReadCapacityUnits, SystemErrors, and GSI-specific throttles. A common blind spot is GSI throttling: the base table may have capacity, but a single overloaded GSI will throttle writes to the entire table.

I set up CloudWatch dashboards with anomaly detection for ReplicaLag and ThrottledRequests so I catch drift early. I also stream slow query logs from RDS/Aurora to CloudWatch Logs and alarm on queries over 1 second. One slow SELECT that holds a lock can cascade into application timeouts. Performance Insights is enabled everywhere; it has saved me hours of digging through pg_stat_activity.

Testing Failover Instead of Trusting It

I run quarterly failover drills. For RDS and Aurora, that means calling aws rds failover-db-cluster or rebooting the primary with --force-failover during a maintenance window and measuring application impact. I verify that RDS Proxy correctly drains connections, that the application retry logic with exponential backoff works, and that read replicas reattach. For DynamoDB Global Tables, I test Region isolation by blocking writes to the replica Region with IAM policy and confirming the application fails over reads.

Backup restores are tested monthly. I restore the latest automated snapshot to a new cluster in a sandbox account and run smoke tests. An untested backup is not a backup. I have seen restores fail because the KMS key for encrypted snapshots was not shared to the restore account. That is the kind of detail you only catch by actually restoring.

Frequently Asked Questions

Can I start with RDS and migrate to Aurora later without downtime?

Yes. Aurora supports migration from RDS MySQL and PostgreSQL via snapshot restore or the Aurora read replica migration method. The replica method is my preferred path for minimal downtime: you create an Aurora read replica of your RDS instance, let it sync, then promote it. You will still need a brief DNS cutover and application restart to point to the new cluster endpoint. Test the cutover in staging with the same dataset size, and watch for parameter group differences between RDS and Aurora that can affect query plans.

When does DynamoDB become more expensive than Aurora for the same workload?

DynamoDB often becomes more expensive when you have high write throughput with multiple Global Secondary Indexes, each of which incurs its own write costs, or when you need strongly consistent reads across most queries. I have seen a workload with 20k WCU and three GSIs cost 2.5x more than an Aurora Serverless v2 cluster handling the same transactions with simpler SQL. Model cost with the AWS Pricing Calculator using your actual item size, read/write ratios, and GSI count, then compare against Aurora ACU hours plus storage. On-Demand DynamoDB is great for spiky traffic but Provisioned with Auto Scaling usually wins for steady high throughput.

Should I use Aurora Serverless v2 for production OLTP?

It depends on your traffic shape. I use Serverless v2 for production when the workload is variable and scales quickly, such as API backends with bursty traffic, or for mixed fleets where the writer is provisioned and readers are serverless. For steady, high-throughput OLTP that runs at 70%+ CPU continuously, provisioned Aurora instances are more cost-effective and have more predictable latency. If you choose Serverless v2, front it with RDS Proxy, set minimum and maximum ACU limits explicitly in Terraform, and load test the scaling behavior so you know how long it takes to go from min to max under your query pattern.

How do I handle analytics queries if my primary database is DynamoDB?

Do not run analytical scans directly against DynamoDB. I export DynamoDB data to S3 via DynamoDB Export to S3 or stream changes via Kinesis Data Firehose, then query with Athena or load into Redshift for analytics. For RDS and Aurora, I create a separate read replica for analytics or use Aurora's parallel query feature to avoid impacting the OLTP primary. Running large scans or aggregations on your primary will cause throttling in DynamoDB or CPU and I/O spikes in RDS/Aurora that affect production latency.

Related Articles

References & Standards: Kubernetes Documentation · Docker Documentation · Terraform Documentation