Design Cost Optimized Architectures · Topic 3 of 5

Cost Optimized Databases

Reduce AWS database cost with the right engine, capacity mode, reserved capacity, Aurora Serverless, DynamoDB billing mode, caching and backup retention.

  • 5 min
In a nutshell
  • Fit the capacity model to the load: reserved for steady, serverless or on-demand for variable.
  • Aurora Serverless v2 scales database capacity with load, and DynamoDB on-demand scales with requests.
  • Use right sizing from monitoring data, and avoid keeping unused or oversized databases.

What it is

Database cost comes from the instance or capacity you run, the storage and input and output you use, backup retention, licensing, and data transfer. Managed services remove administration work, which is a saving of its own, but you still choose how much to pay for.

The exam asks you to fit the database to the load shape: steady, spiky, rarely used, or read heavy. It also expects you to remove waste, such as idle databases, oversized instances and old backups.

Load shapesteady, spiky, idlechooseCapacity modelprovisioned, reserved, serverlessaddSavingscache, retention, clean up

How it works

Choose the engine and the license wisely

Open source engines (MySQL, PostgreSQL, MariaDB) have no license fee, while commercial engines such as Oracle and SQL Server include license cost in the price of RDS License Included instances. A "bring your own license" model can lower cost when you already own licenses.

Moving from a commercial engine to Amazon Aurora is a common cost saving, because Aurora is compatible with MySQL and PostgreSQL. The AWS Database Migration Service and Schema Conversion Tool help with that move.

RDS and Aurora cost levers

LeverHow it saves money
Right size the instanceUse monitoring (CloudWatch, Performance Insights) to drop to a smaller class when CPU and memory are low
Reserved DB instancesA one or three year commitment for steady, always on databases
Aurora Serverless v2Capacity adjusts to load, good for variable or unpredictable workloads
Stop a databaseYou can stop an RDS instance for a limited time for development use, and storage charges continue
Storage choiceUse general purpose SSD unless a workload needs Provisioned IOPS
Backup retentionKeep automated backups only as long as needed, and delete old manual snapshots
Read replicasAdd them only for real read load, since each is a full extra instance

Aurora has two cluster storage configurations. Aurora Standard charges for storage and for I/O requests, which suits most workloads. Aurora I/O-Optimized removes the per request I/O charge in return for higher instance and storage prices, so it can be cheaper when I/O is a large part of the bill.

Multi AZ adds the cost of the standby instance. Use it for production, and consider a single AZ deployment for development and test.

DynamoDB cost levers

DynamoDB has two capacity modes.

ModeBillingChoose it when
On-demandPay per read and write requestTraffic is unknown, spiky or often idle
ProvisionedPay for capacity you set, with optional auto scalingTraffic is steady and predictable

Provisioned capacity can be cheaper for stable load, and reserved capacity lowers the price further for a committed amount.

The Standard-IA table class lowers storage cost for tables that are rarely read. Time to Live (TTL) deletes expired items at no extra cost, which keeps tables small. Also avoid scans in favor of queries, and use projections and indexes carefully, because every index adds storage and write cost.

Caching and offloading

A cache such as ElastiCache or DAX can serve repeated reads at low cost, which lets a smaller database handle the same traffic. Compare the cost of the cache with the cost of larger instances or more replicas.

Analytics and other engines

For Redshift, choose the node type and size to fit the data, use reserved nodes for steady clusters, or use Redshift Serverless for intermittent use. Move cold data to S3 and query it with Spectrum or Athena instead of keeping it all in the warehouse. For rarely queried data, Athena on S3 can cost far less than a database that runs all the time.

Hot datafrequent queriesstays inDatabaseRDS or RedshiftCold datarare queriesmoves toS3 and Athenapay per query

Backups and snapshots

Backup storage, long retention periods and cross Region copies all add cost. Keep them only where your recovery objectives require it. Final snapshots of deleted databases remain until you remove them.

Exam tip

"Unpredictable or intermittent database use" points to Aurora Serverless v2 or DynamoDB on-demand. "Steady load for years" points to reserved instances or provisioned capacity.

What to remember for the exam

  • Fit the capacity model to the load: reserved for steady, serverless or on-demand for variable.
  • Aurora Serverless v2 scales database capacity with load, and DynamoDB on-demand scales with requests.
  • Use right sizing from monitoring data, and avoid keeping unused or oversized databases.
  • Open source engines avoid license cost, and moving to Aurora can reduce commercial license spending.
  • Aurora I/O-Optimized can lower the cost of I/O heavy workloads.
  • DynamoDB Standard-IA table class and TTL reduce storage cost.
  • Caching reduces database size and read replica needs.
  • Trim backup retention and delete old snapshots.

Common mistakes

Provisioning DynamoDB for unpredictable traffic. You either overpay for idle capacity or throttle on spikes. On-demand suits this case.

Adding read replicas when a cache would do. Repeated identical reads are cheaper to serve from memory.

Leaving test databases running 24 hours a day. Stop them, schedule them or use serverless options.

Keeping Multi AZ everywhere. Non production databases rarely need the extra standby instance.

Watch out

Stopping an RDS instance is temporary. It restarts on its own after a limited period, and you keep paying for storage and backups while it is stopped.

Check yourself

  • Which DynamoDB mode suits unpredictable or spiky traffic?

    On-demand capacity mode, which charges per request.

  • How can a company with steady, always on RDS databases lower cost?

    Buy reserved DB instances with a one or three year commitment, after right sizing the instances.

  • What does the Aurora I/O-Optimized option change?

    It removes the per request I/O charge in exchange for higher instance and storage prices, so it helps I/O heavy workloads.

Topic 3 of 5 in Design Cost Optimized Architectures

Test yourself on Design Cost Optimized Architectures

The full AWS SAA-C03 question bank has 823 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.