Continuous cost optimization
There are various practices for optimizing database costs on AWS. These include techniques such as instance right-sizing, moving to Oracle Database SE2, using reserved instances, using Amazon with Graviton2 processors, and optimizing SQL statements.
Right-size your instance
Right-sizing is the process of choosing instance and storage types that meet your specific workload performance and capacity requirements at the lowest cost. It is is a key part of optimizing AWS costs.
The previous section covered Performance Insights, which you can use for performance diagnostics as well as right-sizing and cost optimization. For example, if the CPU load is significantly lower than the number of vCPUs, as shown in the following screen illustration, your instance is oversized and you have a significant cost-savings opportunity.
On the other hand, if the CPU load is significantly higher than the number of vCPUs, your instance undersized, as shown in the following screen illustration. In this case, you have a performance optimization opportunity that requires either optimizing your SQL statements to reduce the average active sessions, or moving to a bigger instance that can meet the load requirements.
Consider moving to Oracle Database SE2
Oracle Database Enterprise Edition (EE) has become the standard for many organizations. However, when you perform an in-depth database assessment, you might find that your application might not need all the features of Oracle Database EE.
Oracle Database Standard Edition (SE) is now available as Oracle Database Standard
Edition 2 (SE2) for Oracle 12c and 19c. Oracle Database SE2 is a relational database
management system (RDBMS) that includes the core features of Oracle Database. These
include features that companies can use to support enterprise-class workloads. Given
the additional features provided by Amazon RDS and Amazon Aurora, which are available for
both EE and SE2 (such as Amazon RDS Multi-AZ
and Amazon RDS for cross-Region automated backups
By switching to SE2, you can optimize Oracle Database license usage. You can provision Oracle Database SE2 for use with Amazon RDS by using both Bring Your Own License (BYOL) and Oracle License Included (LI) options. However, before you decide on such a major change, we recommend that you assess which EE features are being used, which features can be replaced by using Amazon RDS or Aurora capabilities, and which features are mandatory and cannot be replaced or removed, which might prevent you from changing the database edition.
For more information, see Evaluate downgrading Oracle databases to Standard Edition 2 on AWS on the AWS Prescriptive Guidance website.
Use reserved DB instances
You can use Amazon RDS reserved DB instances to reserve a DB instance for a one-year or three-year term, and, in turn, receive a significant discount compared with on-demand DB instances.
You can choose between three payment options when you purchase a reserved instance: All Upfront, Partial Upfront, and No Upfront. With the All Upfront option, you pay for the entire reserved instance before you start using it. This option provides the largest discount compared with on-demand pricing. The Partial Upfront option requires a low upfront payment and a discounted hourly rate for the instance for the duration of the term. The No Upfront option provides a discounted hourly rate for the duration of the term with no upfront payment.
Reserved DB instance types are available in both Amazon RDS and Aurora, for the MySQL, MariaDB, PostgreSQL, Oracle, and SQL Server database engines.
Use AWS Graviton processors
If you migrate from Oracle Exadata to one of the Amazon RDS and Aurora open source
databases, you can benefit from the better cost-performance of AWS Graviton2 and
Graviton3 processors
Optimize your SQL queries
We recommend that you monitor your database performance and identify top SQL statements that consume significant database resources—for example, by using Amazon RDS Performance Insights—on a regular basis. After you identify resource-intensive SQL statements, apply SQL tuning practices to improve database performance. These tuning practices include, but are not limited to, operations such as index creation or deletion, SQL query rewrites, schema modeling, and features such as materialized views.
SQL optimization improves performance, which results in better application
response times and better user experiences, and lowers database costs. For example,
a query might consume 60 percent of the database load because of its associated high
IOPS and CPU, which might require 200,000 provisioned IOPS (PIOPS) and a large Amazon RDS
instance (r5b.24xl
). By optimizing the query—for example, by
creating an index—you can right-size it. As a result, you might be able to pay
less for a smaller Amazon RDS DB instance that has less PIOPS.