← Solutions Architect Associate study path

Performance and cost · 12 min

Amazon EC2 purchasing options for architects

In this lesson you will learn what each Amazon EC2 purchasing option (On-Demand, Savings Plans, Reserved Instances, Spot, Capacity Reservations and dedicated hardware) offers and what it asks in return, and how to combine them so that each part of an architecture pays as little as possible without breaking its requirements.

An Amazon EC2 purchasing option is the way you pay for an , and the same instance can cost very different amounts depending on what you give AWS in exchange for the price. What you give in exchange can be a promise to use it for years, the freedom for AWS to take it away from you, or nothing. For example, a Spot Instance costs up to 90% less than the same On-Demand Instance, but AWS can take it away from you with two minutes' notice, while a Capacity Reservation has no discount at all, but it ensures that the instance will exist.

On the SAA-C03 exam, a question on this topic can give you a whole architecture, which is the set of pieces of an application. For example, an online store can have a web server that runs all year, traffic peaks on weekends, a nightly process and a test environment. Each of those parts can pay with a different option, so the answer can mix several options.

The seven purchasing options

The seven Amazon EC2 purchasing options: On-Demand, Savings Plans, Reserved Instances, Spot, Dedicated Hosts, Dedicated Instances and Capacity Reservations, with what each one offers

The Amazon EC2 documentation lists seven purchasing options. The first three are distinguished by the commitment you make, which is what you promise to pay even if you don't use it later:

  • On-Demand, where you pay per second with no commitment, like a taxi you pay for only while you ride.
  • Savings Plans, where you commit to a fixed amount of spend per hour for 1 or 3 years.
  • Reserved Instances, where you commit to a configuration, that is, to an instance type in a location, for 1 or 3 years.

The other four options are Spot, Dedicated Hosts, Dedicated Instances and Capacity Reservations. Each of them answers a different requirement of the workload, such as tolerating being shut down, having a server of its own or having guaranteed room. For example, the store pays On-Demand for its test environment, because it only turns it on for a few hours and doesn't want to promise anything.

The AWS decision rule

The EC2 documentation gives a rule for choosing among these options based on what the workload needs:

  • If you can't commit to a configuration but you can commit to an amount of spend, the option is Savings Plans.
  • If you need reserved capacity, that is, for AWS to hold instances for you for when you ask for them, the options are zonal Reserved Instances or Capacity Reservations.
  • If the application can run whenever there is capacity and tolerates interruptions, the option is Spot.
  • If the requirement is about or licenses tied to the server, the option is dedicated hardware.

For example, if the store knows it will spend the same amount every hour for three years but doesn't know which instance type it will use, the rule tells it Savings Plans.

Choose the purchasing option based on the workload

Choose how much of the month the workload runs and whether it can be interrupted. The options go from the highest price per hour to the lowest; the one that fits is highlighted.

How much of the month does it run?
Can it be interrupted?
One monthYou pay for the commitment, used or notCosts more per hourCosts less per hourOn-DemandNothing:no termSavings Plansor ReservedA 1 or 3 yearcommitmentSpotAWS canreclaim it

Use Savings Plans or Reserved Instances.

It runs all month and can't be interrupted. If it will keep running like that for one or three years, a commitment lowers the price per hour. AWS recommends Savings Plans over Reserved Instances because they give the same maximum discount with more flexibility.

This is a guide for the exam, without prices: Capacity Reservations and dedicated hardware are not savings options.

Savings Plans

The four types of Savings Plans: Compute, EC2 Instance, Database and SageMaker AI, with the maximum discount and what each one applies to

A Savings Plan is a promise to spend a fixed amount per hour in exchange for a discount on what you use up to that amount. There are four types of Savings Plans, and the fourth one is for SageMaker AI, the machine learning service. The other three are these:

  • Compute Savings Plans, which lower the cost by up to 66% and apply to any EC2 family, size, , and , and also to Fargate and Lambda.
  • EC2 Instance Savings Plans, which lower the cost by up to 72% and are tied to one family in one Region, for example m5 in N. Virginia.
  • Database Savings Plans, which lower the cost by up to 35% on Aurora, RDS, DynamoDB, ElastiCache, DocumentDB, Neptune, Keyspaces, Timestream, DMS and OpenSearch Service, including serverless usage.

The difference between the first two is how much you can change without losing the discount. With Compute Savings Plans you can go from c5 to m5, from Ireland to London or from EC2 to ECS on Fargate and the discount continues. With EC2 Instance Savings Plans, on the other hand, you can only change the size, the operating system and the tenancy within the family. For example, if the store plans to move its servers to containers next year, the Compute Savings Plan keeps its discount after the change.

Reserved Instances

A Reserved Instance (RI) is a discount for promising that you will use an instance type for 1 or 3 years. RIs also reach 72% off, but AWS recommends Savings Plans because they are more flexible. RIs are distinguished in two ways, by their type (Standard or Convertible) and by their scope (zonal or Regional).

A Standard RI gives a bigger discount and you can sell it on the Reserved Instance Marketplace, a store where other customers buy the RIs you no longer need, but you can't exchange it for another one. A Convertible RI, on the other hand, gives a smaller discount and you can exchange it for another one with a different family, operating system or tenancy. For example, if the store doesn't know whether in two years it will need instances with more memory, a Convertible RI lets it change family.

As for scope, a zonal RI reserves capacity in an and a Regional one doesn't, although both cost the same. For example, with a zonal RI the store has its instances ensured in that zone even if many other customers ask for instances on the same day.

Spot Instances

Spot is the EC2 capacity that AWS has unused at the moment and rents at a discount as long as it doesn't need it. It is the option with the biggest discount, which reaches 90% off On-Demand. In exchange, when AWS needs that capacity, it notifies you two minutes in advance and stops, terminates or hibernates the instance.

That is why Spot is used for fault-tolerant workloads, such as data analysis, batch processing, , image or video rendering, containers and even web servers. A database that can't go down, on the other hand, doesn't go on Spot. For example, the store's nightly process that calculates recommendations can go on Spot, because if AWS interrupts it, it runs again later.

Reserved capacity and dedicated hardware

Capacity Reservations don't give a discount, because you pay for the reserved capacity at the On-Demand price whether you use it or not. If you want capacity and a discount together, you combine it with a Savings Plan or a Regional RI. To reserve a cluster of instances, which is a group of instances that work together, there are Capacity Blocks for ML. For example, if the store is going to hold its annual sale on a known date, it reserves the instances with a Capacity Reservation so it doesn't run short that day.

Dedicated hardware has two options, depending on the requirement. Dedicated Hosts give you the physical server for yourself, and with that you can use licenses that are charged per socket or per , which are the server's processors. Dedicated Instances are enough when the only requirement is that the hardware isn't shared with other customers. For example, a company that already paid for a database license charged per core needs to know how many cores its server has, and only Dedicated Hosts gives it that.

EC2 purchasing option decision tree with six questions: interruptions, licenses, single-customer hardware, guaranteed capacity, steady usage and flexibility

To choose the purchasing option for a workload, first check the requirements that rule out options: whether it tolerates interruptions, whether it has licenses tied to the server, whether the hardware has to belong to a single customer and whether it needs guaranteed capacity. After that, how steady the usage is and how much flexibility you need decide how much you commit. For example, the store's web server doesn't tolerate interruptions, has no special licenses and runs all year, so it ends up on a Savings Plan.

cloud path tip: ask those questions once for each part of the architecture, because each part can end up with a different option.

Several purchasing options in one architecture

In the same Auto Scaling group, which adds and removes instances based on demand, you can mix On-Demand and Spot Instances, and Savings Plans or RIs apply their discount to the On-Demand Instances that match. With that, each part of the architecture pays with the option that fits it:

  • The baseline that runs all year, which goes with a Savings Plan or an RI.
  • The peaks you don't know when will arrive, which go on On-Demand.
  • Whatever tolerates interruptions, which goes on Spot.

Discounts are also shared across accounts. If the accounts are in AWS Organizations, the service that brings together a company's accounts, with consolidated billing, which is a single bill for all of them, the RI and Savings Plans discounts are shared among all the accounts in the organization. For example, if the store's sales account doesn't use all of its Savings Plan in an hour, the leftover discount is applied to the test account.

Which option for each part?

0 of 4

An online store has four workloads. Tap the option that costs the least without breaking the requirement of each one.

  1. The 6 web instances that have run 24 hours a day for two years

  2. The extra instances Auto Scaling adds when traffic goes up, with no pattern

  3. The nightly process that recalculates recommendations and can be retried

  4. 50 instances that absolutely have to exist in us-east-2a on the day of the annual sale

If your account uses the new experience

In a new experience account, your projects' policies, which are rules AWS sets on what can be done, deny purchasing Savings Plans, Reserved Instances, Spot, Capacity Reservations and Dedicated Hosts, both in the free plan and in the paid plan. That is why you launch On-Demand Instances, and you study the other options in theory or try them in a full account. The policies don't deny Dedicated Instances, which AWS charges at a price different from On-Demand. For example, if you try to launch a Spot Instance in that account, AWS rejects the request.

On the exam

The questions on this topic describe how each part is used and what can't happen. These words in the question point to the answer:

  • "Steady usage" together with "will change family, Region or move to Fargate/Lambda", which point to Compute Savings Plans.
  • "Fixed family in one Region" together with "maximum discount", which point to EC2 Instance Savings Plans or a Standard RI.
  • "Might need to change the instance type" with RIs, which points to a Convertible RI.
  • "Can be interrupted", "fault-tolerant" or "lowest cost", which point to Spot.
  • "Guaranteed capacity in one zone", which points to a Capacity Reservation or a zonal RI.
  • "Per-socket or per-core licenses", which points to Dedicated Hosts.

For example, if the question says "the job can be restarted if it is interrupted and the goal is the lowest cost", the answer is Spot.

Review question

A company runs a steady EC2 fleet in us-east-1 and plans to move part of it to containers on AWS Fargate over the next year. It wants to lower the cost with a three-year commitment and keep the discount after migrating. What does it buy?

Next