Icon close

Cost Optimisation Spotlight: Relational Database Service (RDS)



This post is part of a series about Cloud Managed DevOps at CMD Solutions.

In this previous post, we covered Cost optimisation at a high level, but now we’ll look into RDS, and the ways you can optimise costs without refactoring.

With any cost optimisation discussion, a big exclaimer that needs to be taken into account is that cost optimisation isn’t always about bringing bills down.  It’s about allocating the right budget to get optimal performance, while also removing waste.

Choose the Right RDS Instance Type and Size

Selecting the appropriate RDS instance type is crucial for cost optimization. AWS offers a variety of instance types, each designed for specific workloads and performance requirements. Analyse your application’s resource utilisation to understand its requirements, as well as the RDS instances usage metrics using the Monitoring tab built into the AWS console, and then choose an instance type and size that best fits your needs. By selecting the right instance, you can reduce costs without compromising performance.

Optimise the storage and I/O costs

Storage and I/O costs are significant factors in your overall RDS expenses. To optimise storage costs, consider using the GP3 (SSD) storage type, which offers a balance of cost and performance. Monitor your database’s storage usage and adjust the allocated storage as needed, ensuring you only pay for what you use.

To optimise I/O costs, enable the RDS Performance Insights feature to identify and resolve performance issues, which can reduce the number of I/O requests. Additionally, ensure that your database is properly indexed, which can improve query performance and lower I/O costs.

Schedule RDS Instances for Non-Production Environments

For non-production environments, such as development, testing, and staging, consider scheduling your RDS instances to run only during business hours. By stopping and starting these instances when they are not in use, you can save a significant amount of money on your RDS costs.

Monitor and Set Up Alerts

Monitoring your RDS instances is crucial for cost optimization. AWS provides several tools, such as Amazon CloudWatch and AWS Trusted Advisor, that can help you monitor resource utilisation, performance, and cost. Set up alerts to notify you when resource usage or costs exceed predefined thresholds, allowing you to take timely action to address any issues.

Multi-AZ Deployments

Multi-AZ deployments provide high availability by replicating your RDS instance across multiple Availability Zones (AZs). While this option increases costs, it also improves the durability and availability of your database. However, you can partially offset these costs by deploying read replicas in the secondary AZ, which can be used to distribute read traffic and reduce the load on the primary instance. This approach can help you to save money on additional read capacity while maintaining high availability. Multi-AZ is great in production environments where uptime and the ability to handle large volumes of traffic are paramount.  In an effort to ensure non-production environments mirror production, we have seen environments where Multi-AZ has been mistakenly applied.  Something to be conscious of.

Utilise Reserved Instances

Reserved Instances (RIs) are a billing option offered by AWS, allowing you to reserve a specific RDS instance type for a predefined period. By committing to a one or three-year term, you can save up to 75% compared to on-demand pricing. To optimise costs, identify RDS instances that run continuously and consider purchasing RIs for these workloads.

Refactor your application

This article is trying to focus on those short-term wins you can gain without a massive undertaking.  That said, usually an application can be looked at to migrate from one database type to another (for example Oracle to Aurora or Postgres), or methods of utilising the database more efficiently from your application.  CMD does Optimization and Licence Assessment studies to investigate the possibility of reducing licencing costs by modifying how you use the database.  If you’d like our assistance on any of this, reach out to us here.

Final thoughts

Optimising RDS costs without refactoring can be challenging, but by implementing these strategies, you can effectively manage your expenses while maintaining the performance and reliability of your database. Remember to choose the right instance type, leverage reserved instances, utilise multi-AZ deployments, optimise storage and I/O costs, schedule non-production instances, and monitor your RDS usage to achieve cost optimization.

Stay up to date in the community!

We love talking with the community. Subscribe to our community emails to hear about the latest brown bag webinars, events we are hosting, guides and explainers.