Skip to content
Pablo Rodriguez

Scaling Databases

Similarly to Amazon EC2 compute resources, AWS database services can also scale vertically, horizontally, or both. How scaling is handled is different for each service. Some services offer manual scaling and auto scaling while other services offer only auto scaling for certain components.

Aurora

Scale a cluster

  • Vertical scaling with instance types
  • Horizontal scaling with read replicas
  • Service managed storage scaling

Aurora Serverless

Scale a cluster

  • Horizontal compute scaling with Aurora Compute Units (ACUs)
  • Service managed storage scaling

Amazon RDS

Scale a database

  • Vertical scaling with instance types and storage volume size and type
  • Horizontal scaling with read replicas

DynamoDB

Scale a table

  • Horizontal scaling to scale read capacity units (RCUs) and write capacity units (WCUs) separately
  • Service managed storage scaling

Aurora can vertically scale a cluster to increase storage as your data in the cluster increases:

  • You can vertically scale an Aurora cluster by changing the EC2 instance size in the cluster
  • The DB instance class determines the computation and memory capacity of an Aurora DB instance
  • Scaling isn’t instantaneous - it can take 15 minutes or more to complete the change to a different DB instance class
  • You can apply the change during the next scheduled maintenance window rather than immediately to avoid affecting users

Horizontal Scaling with Aurora Auto Scaling

Section titled “Horizontal Scaling with Aurora Auto Scaling”

Aurora Auto Scaling dynamically adjusts the number of Aurora Replicas (reader DB instances) provisioned for an Aurora DB cluster:

  • You can specify up to 15 Aurora Replicas to implement horizontal scaling as read-only clusters
  • Aurora Auto Scaling helps your Aurora DB cluster handle sudden increases in connectivity or workload
  • When the connectivity or workload decreases, Aurora Auto Scaling removes unnecessary Aurora Replicas

You define and apply a scaling policy to an Aurora DB cluster:

  • The scaling policy defines the minimum and maximum number of Aurora Replicas that Aurora Auto Scaling can manage
  • Based on the policy, Aurora Auto Scaling adjusts the number of Aurora Replicas up or down in response to actual workloads as determined by using CloudWatch metrics and target values

The Aurora service automatically manages Aurora storage scaling in the cluster volume.

On-Demand

Aurora Serverless is designed for workloads that can be intermittent and unpredictable. There can be periods of heavy workloads that might last only a few minutes or hours, and also long periods of light activity, or even no activity.

Some examples include:

  • Retail websites with intermittent sales events
  • Reporting databases that produce reports when needed
  • Development and testing environments
  • New applications with uncertain requirements

With Aurora Serverless you create a database endpoint without specifying the DB instance class size:

  • You specify database capacity with minimum and maximum Aurora capacity units (ACUs)
  • Each ACU is a combination of approximately 2 gibibytes (GiB) of memory, corresponding CPU, and networking
  • Aurora Serverless scales the resources vertically automatically based on the minimum and maximum capacity specifications
  • Automatically start up, shut down, and scale capacity up or down based on your application’s needs
  • Run your database in the cloud without managing any database instances
  • Pay on a per-second basis for the database capacity that you use when the database is active
  • You can migrate between standard and serverless configurations
  • You can stop and start a cluster for intermittent workloads

DB Instance Class Scaling:

  • You can vertically scale your Amazon RDS database (DB) instance by changing the Amazon RDS instance class
  • Your database is temporarily unavailable while the DB instance class is modified
  • Occurs during the maintenance window unless you specify that the modification should be applied immediately

Multi-AZ vs Single-AZ:

  • There is minimal downtime when scaling up your Amazon RDS instance on a Multi-AZ environment because the standby database gets upgraded first, and then a failover occurs
  • A Single-AZ Amazon RDS instance is unavailable during the scaling operation

Storage Scaling:

  • When you scale your database instance up or down, your storage size remains the same and is not affected by the change
  • You can separately modify your DB instance to increase the allocated storage space or improve the performance by changing the storage type
  • You can use Amazon RDS storage autoscaling to automatically scale storage capacity in response to growing database workloads

Amazon RDS uses the built-in replication functionality of the MariaDB, MySQL, Oracle, and PostgreSQL DB engines to create a special type of DB instance called a read replica from a source DB instance:

  • Updates that are made to the source DB instance are asynchronously copied to the read replica
  • You can reduce the load on your source DB instance by routing read queries from your applications to the read replica
  • You can promote the read replica to the primary database if it becomes unavailable
  • Redirecting read traffic for business reporting and reading queries from applications
  • Disaster recovery - though it’s important to note that read replicas are not a replacement for the high availability and automatic failover capabilities that Multi-AZ provides

When you create a new table in DynamoDB, you must specify the table capacity mode:

Automatic Scaling

  • DynamoDB accommodates your workloads based on actual reads and writes to the table
  • If a workload’s traffic level hits a new peak, DynamoDB adapts rapidly to accommodate the workload
  • Works well for spiky or intermittent workloads

By default, the DynamoDB table in provisioned mode activates read capacity and write capacity auto scaling:

  • DynamoDB auto scaling uses the Application Auto Scaling service to dynamically adjust provisioned throughput capacity
  • Enables a table or a global secondary index to increase its provisioned read and write capacity to handle sudden increases in traffic without throttling
  • When the workload decreases, Application Auto Scaling decreases the throughput so that you don’t pay for unused provisioned capacity

In addition to tables, DynamoDB auto scaling also supports global secondary indexes:

  • Every global secondary index has its own provisioned throughput capacity that is separate from that of its base table
  • Application Auto Scaling adjusts the provisioned throughput settings for the index to ensure that its actual utilization stays at or near your desired utilization ratio
  • You can reduce the load on the base table with a global secondary index table
ScalingAuroraAurora ServerlessAmazon RDSDynamoDB
ScopeClusterClusterDatabaseTable
Vertical ScalingInstance class or sizeCluster ACU throughput limits with each Reader and Writer automatically scaled within limitsInstance class or size, Amazon RDS storage auto scalingN/A
Horizontal ScalingAurora Auto Scaling for read replicasMulti-AZ replicas, Reader replicasRead replica databasesOn-demand mode, Provisioned mode with Application Auto Scaling, Global secondary indexes
Managed by AWSStorage scalingStorage scalingN/AStorage scaling

Aurora allows you to choose database instance class size and number of Aurora Replicas, while Aurora Serverless scales resources automatically based on minimum and maximum capacity specifications. You can manually vertically scale compute capacity for your RDS DB instance and use read replicas to horizontally scale your RDS DB instance. DynamoDB On-Demand offers pricing based on actual table reads and writes, and DynamoDB auto scaling uses Application Auto Scaling to dynamically adjust provisioned throughput capacity.