Domain 4: Cost-optimized architectures
Cost-effective storage solutions
Yous should know which storage service should be used, an object storage, or a file storage and identify the cost optimized storage.
Right-size EBS volumes
Pick the right size, don't over provision more than you need
You need to have a good idea about how much storage you actually need to determine this. AWS Trusted Advisor can help you advise on what kind of volume to pick.
Delete old EBS snapshots that are basically incremental backups if you don't need them.
S3
Object are stored with standard storage class by default in S3, it has high cost for storing the object, but low cost for retrieval of the object.
You can pick different storage class depending on the use case.
- S3 Standard: Highest cost of storing, but very low retrieval cost
- S3 Standard-IA (Infrequent access): Kind of high cost of storing, and a little bit more costly for retrieval
- S3 Glacier: Low cost of storing, high retrieval cost
- S3 Glacier Deep archive. Very low cost of storing, very high retrieval cost
S3 intelligent-tiering can be used for variable or unknown access pattern; to automatically select a tier for your S3 storage.
Cost-effective compute and database services
EC2 pricing models
- On-demand instances: You pay by hour of usage for AWS instances
- Reserved instances: A user locks in a AWS instances for a span of 1 or 3 years and gets a significant discount compared to on-demand pricing. However, the drawback is that reserved instances are assigned to a specific availability zones.
This is different than saving plans because the configuration of the instances is locked, while savings plan you can change the instance configurations as long as you keep using it. - Dedicated instances: No noisey neighbor per say because non-dedicated instances can be run on the same hardware so you will be sharing the hardware with other people. If their usage spike up it might affect your performances. To avoid this you reserve yourself own dedicated hardware without sharing with other people.
- Spot instances: User bid for the price of a spare EC2 instances. A market price is set for a spare instances.
- Saving plans: Apply to EC2 and other services by making a commitment to a consistent usage, for 1 or 3 years.
EC2 size and family
Pick a EC2 instance that is right for your workload. Low utilization you have option to make instane smaller.
Right-sizing EC2 instances and RDS DB instances are a good way to optimize for cost.
Pick the right amount of CPU and RAM to do the job.
However, scaling up is usually costly, so it is best to look for alternatives rather than scaling up all the time.
Database services
Depending on the use case, you should pick the best database.
Use managed services when possible. Remove operational burden of maintaining servers for tasks, like running apps or managaing databases. So basically you removed some of the manual tasks that is required for say maintaining a server, or keep an app up and running in EC2 instances and offload them to AWS.
AWS Lambda you don't have to worry about setting up the servers and everything, just write the code and deploy it ez. Free up the people that are required to manage these things to do something else instead.
Ex: fargate for containers, aws lambda for serverless compute, dyanmoDB for database
Cost-optimized network architectures
Data transfer and API calls might incur costs as well. S3, you pay for the data that you stored, but you also spend money on the API calls that you made to S3.
So the good way to optimize cost is to reduce the amount of API calls and data transfer that is occurring. One solution to this is to use CDN (Amazon CloudFront) as a cache. If the object is found in CloudFront, then it will just be returned, if it isn't then it will request S3 for the object, and send it back.
Connectivity on-premise and AWS
Use AWS managed VPN for data transfer instead of AWS direct connect for more cost-effective solutions.
There are also connect to NAT gateways and transit gateways! Not everything is free bruh.
No Comments