Problem
Database environments are dynamic: databases grow, workloads change, and this requires a focus on scalability, performance tuning, resource optimization, and cost optimization. Organizations migrating to cloud providers such as AWS need to understand the benefits of cloud flexibility, which provides multiple ways to optimize costs without degrading database performance or availability.
Solution
If you are migrating SQL Server to AWS or already have SQL Server workloads running there, this article provides a comprehensive guide to key cost-saving strategies for SQL Server on AWS.
Table of contents
- AWS Deployment Options
- Right-Size SQL Server running on Amazon EC2 for Lower AWS Compute Costs
- Right-Sizing Considerations for Amazon RDS and RDS Custom
- Reduce SQL Server Costs in Development and Test Environments
- Optimize SQL Server Licensing on AWS
- AWS Licensing Models for SQL Server
- Licensing Optimization Strategies on AWS
- Optimize SQL Server Backup and Storage Costs
- Reduce High Availability Costs for SQL Server on AWS
- Modernize SQL Server to Reduce Long-Term AWS Costs
AWS Deployment Options
AWS provides three options for deploying SQL Server. These options vary in features, management responsibilities and cost structures. Let’s briefly explain each of these to provide context to the cost savings.
Amazon EC2 for SQL Server
Amazon EC2 provides customers with complete control over the operating and database environment, like an on-premises deployment. Users have operating system-level access to the EC2 instance, managing their own patching schedules, configure settings, and more. There are also several options for configuring High Availability (HA) and Disaster Recovery (DR), including Always on Availability Groups (AGs) and Always on Failover Cluster Instances (FCIs).
Customers have flexibility in choosing the license model from AWS license. These options included AMIs (pay-as-you-go) or bring your own existing SQL Server licenses (BYOL). BYOL is especially helpful for scenarios involving existing enterprise licensing agreements.
Amazon RDS for SQL Server
Amazon RDS for SQL Server provides fully managed cloud database solutions enabling organizations to focus on their applications and data instead of day-to-day database management. The Amazon RDS managed database solution includes automated backups (including point-in-time recovery), configuration, monitoring, High Availability and Durability (Multi-AZ (Availability Zone) deployments).
Further, customers have the option to not pay any upfront fees or make long-term commitments using hourly pricing. AWS also offers reserved database instances that enable users to pay a one-time upfront fee (up to 65% net cost savings) for 1- to 3-year reservations.
Amazon RDS Custom for SQL Server
Amazon RDS Custom for SQL Server is also a managed database service and a middle ground between Amazon EC2 and Amazon RDS. It is designed to support legacy custom applications that require granular control, which is available with Amazon EC2, and want the benefits of a managed service like Amazon RDS.
Amazon RDS Custom for SQL Server provides operating system administration access and sysadmin access at the database level. It also automates management tasks such as backups, patching (shared responsibility), multi-AZ configuration, and monitoring, etc., which all result in reducing the operational burden.
Amazon Deployment options Selection Considerations
Choosing Amazon EC2, RDS, or RDS Custom depends on specific factors and trade-offs between control, convenience, and cost.
- Use Amazon EC2 for SQL Server if you need complete control over the operating system and database engine, advanced performance tuning, and extensive customization. Keep in mind, this option can incur higher operational and licensing costs if resources are not well optimized and right-sized.
- Use Amazon RDS Custom for SQL Server as the middle ground to reduce administrative overhead, while maintaining access to the operating system and the database engine.
- Use Amazon RDS SQL Server to leverage the fully managed service and reduce the administrative burden for backup, patching, maintenance, and scaling. It can provide a lower total cost of ownership for common and moderately complex workloads by reducing operational effort and improving consistency.
The following diagram illustrates the responsibilities of AWS and the user in managing SQL Server features and operations.

Image Source: Choosing between Amazon EC2 and Amazon RDS
Right-Size SQL Server running on Amazon EC2 for Lower AWS Compute Costs
When it comes to right-sizing consideration for Amazon EC2 on SQL Server, it is necessary to evaluate the SQL Server workload, SQL Server edition, as well as CPU, Memory, Disk IOPS, and Network requirements then choose an appropriate EC2 instance configuration. It is advisable to use the AWS pricing calculator for cost analysis with different combinations of instance types, SQL Server licensing options, etc.
Example Cost Optimization – Amazon EC2
Let’s look at an example cost optimization with right sizing the instance and downgrading the SQL Server licensing from Enterprise to Standard in the US-East-1 region.
Here is a snapshot before optimization:
| Server Instance | vCPU | SQL Server 2022 Edition | Total Monthly Cost (EC2 + License) |
|---|---|---|---|
| r7i.2xlarge | 8 | Enterprise | $2,654.28 |
| r7i.2xlarge | 8 | Enterprise | $2,654.28 |
| Total | $5,308.56 |
After optimization the SQL Server edition (moving from Enterprise to Standard), there is a monthly cost savings of $2,978.40 resulting in a yearly cost savings of $35,740.80. This is a significant savings.
| Server Instance | vCPU | SQL Server 2022 Edition | Total Monthly Cost (EC2 + License) |
|---|---|---|---|
| r7i.2xlarge | 8 | Standard | $1,165.08 |
| r7i.2xlarge | 8 | Standard | $1,165.08 |
| Total | $2,330.16 |
Right-Sizing Considerations for Amazon RDS and RDS Custom
For Amazon RDS and RDS Custom, it is recommended to start with the smallest instance class that satisfies your performance requirements. Then monitor CPU and Memory utilization to scale the AWS RDS instance as needed. Review Scaling Your Amazon RDS Instance Vertically and Horizontally for more detailed recommendations.
Further, select the appropriate SQL Server edition based on your application needs. Standard edition will help reduce costs compared to Enterprise edition. Similarly, use a Single-AZ (Availability Zone) for development, test or non-critical environments and Multi-AZ (Availability Zone) for critical databases with disaster recovery requirements.
An additional cost savings consideration is using Reserved DB Instances for steady-state workloads. These Reserved Instances can save you up to 69% over on-demand rates when used in a steady state.
It is also necessary to plan your Backup and Retention Strategy due to the storage costs. We will cover those considerations later in the article.
As a final recommendation, it is prudent to conduct monthly or quarterly rightsizing to ensure resources are being used in the most cost-effective manner.
Additional Information
- Options to run SQL Server on the AWS Cloud
- Decision Tree for migrating and modernizing SQL Server workloads
- Migration and modernization strategies for your SQL Server workloads on AWS
Reduce SQL Server Costs in Development and Test Environments
There are three main strategies for cost reduction in Development, Test and Staging environments these include Developer Edition, the Linux operating system and stopping instances during idle time periods. Let’s dive into each.
SQL Server Developer Edition
Install SQL Server Developer Edition for Development, Test, and Staging environments. Developer Edition is supported on both EC2 and RDS and can yield significant cost savings. The following table illustrates general SQL Server licensing costs when migrating from Enterprise to Developer or Standard to Developer. As you can see, there is a significant licensing savings by installing Developer edition based on usage. This cost savings specifically relates to AWS costs with LI AMI or BYOL licensing.

Image Source: Cost impact
Linux Operating System
A second option to reduce licensing costs in Development, Test and Staging environments is to run SQL Server on Linux to eliminate Windows licensing costs. This can be as much as a 20% savings on the operating system costs in the US-East-1 region. Also, this is an option for Production environments as well to reduce operating system licensing costs.
| Scenario | OS | SQL Edition | Compute + Licensing | Total Est. Monthly Cost |
|---|---|---|---|---|
| Linux Only | Linux | None | $193.16 (Base Compute) | $193.16 |
| Windows Only | Windows | None | $193.16 + ~$143.08 (OS Fee) | $336.24 |
| Linux + SQL Server | Linux | Standard | $193.16 + ~$350.40 (SQL Fee) | $543.56 |
| Windows + SQL Server | Windows | Standard | $336.24 + ~$350.40 (SQL Fee) | $686.64 |
| Linux + SQL Server | Linux | Enterprise | $193.16 + ~$1,095.00 (SQL Fee) | $1,288.16 |
| Windows + SQL Server | Windows | Enterprise | $336.24 + ~$1,095.00 (SQL Fee) | $1,431.24 |
Idle Time Periods
A final cost savings consideration for Development, Test and Staging environments is to stop EC2 instances during idle periods such as overnight, weekends, and holidays to avoid incurring compute charges. Similarly, you can stop the RDS and RDS Custom instance for up to 7 days. Depending on the instances, this can save a significant amount per month.
Optimize SQL Server Licensing on AWS
SQL Server licensing is based on the number of vCPUs assigned to a Virtual Machine (VM) in shared tenancy or the number of physical cores on a Dedicated Host, with a minimum of 4 core licenses required per VM. Right sizing the instance is a key strategy for optimizing the license usage. It requires evaluating CPU, memory, and storage requirements and selecting the appropriate instance type. You can lower the number of cores during rightsizing and reduce the associated license costs.
AWS Licensing Models for SQL Server
Choosing the right licensing model enables you to adopt a cost-effective architecture, including:
- License Included (LI): In this mode, AWS provides a pay-as-you-go model for SQL Server deployments with no upfront costs and hourly charges. It is excellent for flexibility and short-term requirements.
- Bring Your Own License (BYOL) with license mobility: You can use Microsoft’s license mobility program to move an existing SQL Server license with Software Assurance (SA), and it can save on AWS instance costs for SQL Server.
- BYOL products without license mobility: Products such as Windows Server do not support License Mobility through Software Assurance. To use existing Windows licenses on AWS, you must deploy on Amazon EC2 Dedicated Hosts, where licensing is applied at the physical core level.

Image Source – Understand SQL Server licensing
Licensing Optimization Strategies on AWS
AWS provides multiple ways to optimize the license costs. Let’s briefly discuss them to provide context to license cost savings.
Utilizing Physical Server Licensing (Dedicated Hosts)
AWS provides licensing at the physical core level of a host. With this strategy, you can deploy multiple instances up to the host’s capacity without increasing SQL Server core license requirements. Licensing is applied at the physical core level. This approach applies to SQL Server Enterprise Edition and Windows Server Datacenter.
For example, look at the figure below. This Dedicated Host contains 48 physical cores, and licensing is applied at the physical core level, allowing deployment of up to 96 vCPUs without increasing SQL license requirements. You can now deploy multiple VMs with up to 96 vCPUs.

Image Source – Understand SQL Server licensing
Consolidate Multiple SQL Server Instances on Virtual Machines
Microsoft requires a minimum of 4-core SQL Server licenses per VM. If you have a VM with 2 vCPU, you still need a 4-core SQL Server license.
Let’s consider the following example in which we have four SQL Server instances with 2vCPUs per VM. Without consolidation, you need to have 16 core SQL Server licenses although you are only using 8 vCPU across the VMs as shown in the table below.
| Unoptimized Instances | |||
|---|---|---|---|
| AWS VM | SQL Server Instances | SQL Server CPU Usage | SQL Server License Usage |
| m7.large | SQL Server #1 | 2 vCPU | 4 Core Licenses |
| m7.large | SQL Server #2 | 2 vCPU | 4 Core Licenses |
| c7.large | SQL Server #3 | 2 vCPU | 4 Core Licenses |
| c7.large | SQL Server #4 | 2 vCPU | 4 Core Licenses |
| Total | 8 vCPU | 16 Core Licenses | |
Now, if we consolidate SQL Server instances into two VMs, we can optimize SQL Server licenses and reduce the licensing requirements by 50% (from 16 Core SQL Server licenses to 8 Core SQL Server licenses) as shown in the table below.
| Optimized Instances | |||
|---|---|---|---|
| AWS VM | SQL Server Instances | SQL Server CPU Usage | SQL Server License Usage |
| m7.xlarge | SQL Server #1 SQL Server #2 | 4 vCPU | 4 Core Licenses |
| C7.xlarge | SQL Server #3 SQL Server #4 | 4 vCPU | 4 Core Licenses |
| Total | 8 vCPU | 8 Core Licenses | |
Downgrade SQL Server Enterprise to Standard edition
Downgrading from SQL Server Enterprise to Standard Edition can significantly reduce licensing costs (often 60–70%), depending on your agreement and required features. You may consider switching to Standard Edition after validating that Enterprise-only features (such as Always On Availability Groups, online indexing, advanced compression, or partitioning) are not required.
Here are two examples of downgrading from SQL Server 2022 Enterprise Edition to Standard Edition with a 73% cost savings based on the US-East-1 region.

Image Source – Reduce Microsoft SQL Server licensing costs with AWS Compute Optimizer
Be sure to evaluate and compare SQL Server features between the Enterprise and Standard editions to validate whether enterprise-level features are necessary.
Leverage Optimize CPU features
The initial step in deploying SQL Server on AWS EC2 is to build and configure the virtual machine (EC2) using the available instance types. The instance type refers to the combination of CPU, Storage, RAM, and network configuration.
Suppose your workload requires 200,000 IOPS for a critical application. You referenced the AWS instance types and selected the r6idn type.16xlarge instance type.

Image Source – Amazon EBS-optimized instance types
This instance supports 32 cores (64 vCPUs). Therefore, you can consume 64 SQL Server Core licenses.

Image Source – Optimize CPU best practices for SQL Server workloads
If your workload does not require 64 vCPUs, do you still need to license all 64 cores? No, you can leverage Optimize CPU features to manage vCPUs. It works in three ways:
- Disable hyperthreading (set threads per core to 1)
- For example, 64 Cores to 32 Cores
- Often times the performance impact is minimal, but the license cost saving is significant
- Reducing the core count: Example reducing cores from 32 to 16
- Both Option 1 and Option 2: Reducing the core count (32 to 16) and disable the hyperthreading (Threads 1)
The following table outlines the SQL Server licensing cost optimization of 75% by leveraging the optimize CPU feature without changing the instance type to meet IOPS requirements.

Image Source – Optimize CPU best practices for SQL Server workloads
Look at the following table and graph to visualize the cost optimization without performance impact:
- CPU optimization can lead to a 62.5% decrease in the number of required SQL Server licenses
- ~43% decrease in the monthly cost of deploying SQL Server
- Reducing the cost /1,000 TPM from $22.90 to just $13.22

Image Source – Optimize CPU best practices for SQL Server workloads
Performance test results with and without the hyperthreading on AWS EC2 r16idn.16xlarge instance.

Image Source – Optimize CPU best practices for SQL Server workloads
Comparison – Shared Host and Dedicated Host with Bring Your Own Licensing and Licensing Included
The following table presents a side-by-side comparison of costs, licensing, and infrastructure for three SQL Server deployment models on AWS in the US-East-1 region.
| Item | Scenario 1: Windows (LI) + SQL (LI) Shared Host | Scenario 2: Windows (LI) + SQL (BYOL) Shared Host | Scenario 3: Windows (BYOL) + SQL (BYOL) Dedicated Host |
|---|---|---|---|
| Tenancy Model | Shared (Instance) | Shared (Instance) | Dedicated Host |
| Instance / Host Type | r7i.8xlarge | r7i.8xlarge | r7i Dedicated Host |
| Number of Servers | 6 | 6 | 6 (on 2 hosts) |
| vCPU per Server | 32 (to get 256GB RAM) | 32 (to get 256GB RAM) | 32 |
| Total vCPUs / Cores | 192 vCPUs | 192 vCPUs | 96 physical cores |
| Windows Licensing | License Included | License Included | BYOL (Core-based) |
| SQL Licensing | License Included (SQL 2022 Ent) | BYOL (SQL 2022 Ent) | BYOL (SQL 2022 Ent) |
| Hourly Cost (per unit) | ~$11.08 | ~$3.10 | ~$5.85 (per host) |
| Monthly Cost (per unit) | ~$8,088 | ~$2,263 | ~$4,270 (per host) |
| Total Monthly Cost | $48,528 | $13,578 | $8,540 |
| Savings vs Scenario 1 | — | $34,950 | $39,988 |
We can derive the following output from the comparison of the data above:
- Moving from License Included (Scenario 1) to SQL BYOL (Scenario 2) reduces AWS spend by ~70%.
- Moving to Dedicated Hosts with full BYOL (Scenario 3) provides the lowest total cost.
- Dedicated Hosts reduce SQL licensing requirements from 192 vCPU cores to 96 physical cores, significantly improving license efficiency.
Optimize SQL Server Backup and Storage Costs
Optimizing SQL Server backup storage costs can significantly reduce cloud expenses while maintaining backup efficiency, data protection and compliance requirements.
In this section, we will focus on optimizing overall cost by optimizing storage tiers and backup strategies while outlining options to meet business requirements.
Define Backup Retention Policies
Backup retention policies depend on the following factors:
- Data Classification
- Business Criticality
- Regulatory Requirements
For example, data retention requirements vary for the healthcare industry. An organization may need to retain 6 to 10 years of data depending on HIPAA or local regulations. Consumer data applications are also bound by GDPR or regional privacy laws, which may require years of retention. In contrast, an organization might need only 30 to 60 days of retention for non-critical data.
Therefore, the organization needs to planning accordingly to prevent over-retention that can unnecessarily increase storage consumption. The planning may include:
- Implementing policy-based retention
- Archival tiering for Hot, Warm and Cold Storage based on usage
- Periodic compliance reviews
Amazon S3 Storage Tiers
Amazon S3 provides multiple storage tiers based on data access frequency:

Image Source: S3 & Storage Options: Navigating AWS’s Object Storage
Storage considerations:
- S3 Standard is for frequent access costing around $0.023/GB for tiered pricing
- Amazon S3 Infrequent Access (IA) pricing offers lower storage costs at $0.0125/GB/month as compared to S3 Standard
- S3 Glacier Deep Archive is for long-term archiving with pricing as low as $0.004/GB/month
Sample Storage Cost for AWS S3 Standard
Let’s say our daily backup size is 1 TB and remains static for the next 24 months. Here is a common storage scenario:
- Daily Backup: 30 days – 30 Copies – 30 TB
- Weekly Backups: 3 Months – 12 Copies – 12 TB
- Monthly Backups: 24 Months – 24 Copies – 24 TB
If we store all the backups on S3 Standard storage, the total cost will be:
Total Copies * Storage tier Cost
= (30+12+24)TB * 0.023 per GB/Month
= $1518 /Month
We will refer to these costs as the Total Cost Without Storage Optimization.
Let’s use the AWS storage tier options to deliver storage optimization cost savings in the US-East-1 region.
| Total Cost with Storage Optimization | |||||
|---|---|---|---|---|---|
| Backup | Total Monthly Backup Count | Storage Tier | Total Size | Storage Tier Cost | Total Cost |
| Daily | 30 | S3 Standard | 30TB | $0.023/GB | $690 per month |
| Weekly | 12 | S3 IA | 12 TB | $0.0125/GB | $150 Per Month |
| Monthly | 24 | Glacier Deep Archive | 24 TB | $0.004 | $96 Per Month |
| Total | $936 Per Month | ||||
Backup Cost Calculations:
- Total Cost Without Storage Optimization = $1518 /Month
- Total Cost With Storage Optimization = $936 /Month
- Monthly Saving: $582
- Percentage Saving: ($582/$1518)*100 = 38.34%
As shown here, using storage tires can reduce storage costs by approximately 40% without affecting recovery objectives. You can use the S3 lifecycle configuration to change storage tiers according to the defined schedule automatically.
Amazon S3 Intelligent Tiering
Amazon S3 Intelligent Tiering is mechanism to save on storage costs automatically. This service moves data to the most cost-effective access tier based on data access patterns. According to AWS, customers have saved more than $6 billion in storage costs by using S3 Intelligent-Tiering instead of Amazon S3 Standard since 2018.
- For backup workloads with unpredictable access patterns, enabling Amazon S3 Intelligent-Tiering can automatically optimize storage costs, typically reducing costs by up to 30% compared to S3 Standard.
SQL Server Database Backup Compression
Another option to reduce storage costs is with SQL Server backup compression which produces backup files that are significantly smaller than uncompressed database backups. Backup compression reduces storage requirements and often improves I/O performance during backups. For example, a 3:1 compression ratio reduces backup storage consumption by approximately 66%, significantly lowering storage costs.
Backups and Region Cost Considerations
AWS S3 provides 99.999999999% (11 nines) durability within a single region. This uptime is adequate for non-critical workloads, such as development, testing, or staging environments as well as some production environments. You can enable cross-region replication (CRR) to replicate storage across multiple regions. However, there are charges for storage in both areas, replication put requests, and inter-region data transfer, so keep these costs in mind. It is possible to reduce the costs for multi-region replication with a combination of S3 One Zone-IA and S3 CRR.
S3 Versioning
A final recommendation is to avoid enabling S3 versioning for backup storage because older object versions consume additional space and increase storage costs.
Reduce High Availability Costs for SQL Server on AWS
High availability is essential to meet the requirements of any critical application. The application should be up and running in accordance with the agreed upon SLA and customer expectations.
SQL Server Always On Availability Groups provide high availability and disaster recovery capabilities for SQL Server workloads. However, implementing HA on AWS can significantly increase licensing and infrastructure costs. The following techniques can help reduce high-availability costs for SQL Server on AWS:
- SQL Server Standard Edition – Basic Availability Groups: The SQL Server Standard edition supports Basic Availability Groups (one availability group per database with limited replicas). Using Basic Availability Groups instead of Enterprise Edition Always On Availability Groups can significantly reduce licensing costs—often by 65–75%, depending on the architecture.
- Failover Cluster Instance (FCI) with Shared Storage: You can configure high availability with a SQL Server failover cluster instance with shared storage. Solutions such as SIOS DataKeeper enable FCI deployments across Availability Zones or Regions. This potentially reduces overall HA infrastructure and licensing costs estimated 58–71%, depending on configuration.
- Log Shipping for Disaster Recovery: SQL Server log shipping is another cost-effective option for disaster recovery. It provides secondary database copies at a lower licensing cost and can reduce overall HA/DR expenses by approximately 65–75%, depending on the deployment model.
The following table compares high-availability solutions and their costs for both standard and enterprise editions for the US-East-1 region with r5d.xlarge instances and licenses included for both Windows and SQL Server.

Image Source: Choose a high availability and disaster recovery solution
Passive Secondary Replica
AWS waives the SQL Server license fee for a passive secondary replica in SQL Server Always On Availability running on Amazon EC2. This is the case as long as the secondary instance is not actively serving application traffic or handling read workloads. This paradigm benefits organizations by:
- Achieving high availability and disaster recovery.
- Maintaining enterprise-grade resiliency without doubling licensing costs.
- Reducing additional SQL Server licensing fees for standby nodes.
However, there are some requirements to qualify as a passive replica:
- The secondary instance must not serve read-only workloads (i.e. no incoming traffic).
- It must not run reporting, analytics, or other production workloads.
- It can only be used for synchronization and failover purposes.
- The instance does not have a standalone database running without the SQL Server Availability Group.
This licensing benefit makes AWS a cost-effective option for implementing SQL Server High Availability architectures while ensuring compliance with Microsoft licensing policies.
Modernize SQL Server to Reduce Long-Term AWS Costs
SQL Server modernization includes migrating from legacy database systems to open-source databases on AWS to improve scalability, performance and cost savings. For example, switching from SQL Server Enterprise Edition on Amazon EC2 to Amazon RDS for PostgreSQL or Amazon RDS for MySQL can result in cost savings up to 80 percent. Also, switching from SQL Server Enterprise Edition on Amazon EC2 to Amazon Aurora PostgreSQL-Compatible Edition or Amazon Aurora MySQL-Compatible Edition can result in cost savings up to 70 percent.
Also, the AWS PaaS abstracts the infrastructure management tasks such as OS patching, monitoring, scaling, and backups from the IT Team. It allows the Technology Team to focus on their development tasks instead of managing infrastructure. Therefore, you can achieve lower operational costs (OpEx) than with IaaS.
Next Steps
- Check out these videos to learn more about AWS Cost Optimization:
- Explore MSSQLTips.com AWS EC2 and AWS RDS resources
- Read Best practices for deploying Microsoft SQL Server on Amazon EC2
- See these Field Notes: SQL Server Deployment Options on AWS Using Amazon EC2

Hi! I am Rajendra Gupta, Database Specialist and Architect, helping organizations implement Microsoft SQL Server, Azure, Couchbase, AWS solutions fast and efficiently, fix related issues, and Performance Tuning with over 14 years of experience.
I am the author of the book “DP-300 Administering Relational Database on Microsoft Azure.” I can be reached at: Rajendra.gupta16@gmail.com for any consulting help.
- MSSQLTips Awards:
- Author of the Year – 2022 | Author Contender – 2021/2023/2024 | Champion Award (100+ tips) – 2020


