AWS Applications and Services Flashcards
DynamoDB
Dynamo - dinosaur notebook filled with stickers (you write down what’s happening rn, more real-time), unstructured data, nonSQL data
used in AI/ML for storing real-time data (i.e. what users are clicking on)
supporting storage layer for fast, quick-access needs, but not typically the main storage layer
Redshift
data warehouse (structured data) - think library where you store/study old notes (vs. dynamo real-time notebook), structured data
relational database, queried with SQL
vs data lake which is unstructured
EC2
Amazon EC2 (Elastic Compute Cloud) is a web service that provides scalable computing capacity in the cloud. It allows you to rent virtual servers, known as “instances,” to run applications, store data, and perform other tasks. EC2 is flexible and enables you to choose the size, type, and configuration of your instances based on your needs, helping you scale up or down easily as your workload changes. It’s like renting a computer in the cloud that you can customize to meet your specific requirements.
AWS Lambda vs EC2
EC2 - provides the VMs (instances) for you to run your applications. you manage the servers and decide when you want the instances up and live, you pay for the instance whether it’s running or sitting idle. Best for apps where you need long-running compute power (web hosting, database management, anything with persistent needs)
= manual scaling/configuration
Lambda - serverless computer where you don’t have to manage the underlying infra. You upload your code, and Lambda automatically runs it in response to events (e.g., HTTP requests, file uploads, database changes). You pay based on number of requests and time it takes your code to execute. Only pay for when code is running, not when idle. Ideal for event-driven apps (API calls, image processing)
= auto scaling, event-driven architecture`
Write a scenario where Lambda could replace a traditional server for efficiency.
Image upload system (or something where you’re uploading to a s3 bucket) - traditional server would require you to manage the infrastructure, you’d have to pay for the compute costs regardless of if images were being uploaded or not, you could either have excess capacity or not enough dependent of flux of demand because you have to scale it, event-driven – only incur costs for actual usage when the function is invoked.
Lambda function
Lambda function = A tiny program that runs only when something happens (like a new file upload or a new message) and does a specific job (like resizing an image).
EC2 Pricing
1) on demand pricing (by second)
2) Savings Plan - requires 1 or 3 year commits, but can include other AWS services (fargate, lambda etc so better for diverse workloads). contractually committed, steady state use
3) spot instances - just borrowing spare AWS capacity, they can ask for it back, only really good for batch workloads that can be interrupted
Reserved/dedicated capacity
Fargate
serverless ECS, you just pay for running containers vs having to pay for EC2 server usage and handle scaling
Savings Plans
Contractually committed, steady state use, significant cost savings vs on-demand, requires 1 or 3 year commits, but can include other AWS services (fargate, lambda etc so better for diverse workloads).
Compute Savings Plans, EC2 Instance Savings Plans, and Amazon SageMaker Savings Plans
Spot Instances
Borrow EC2 capacity, up to 90% discount
Good for:
- stateless/fault tolerant - can be stopped, and doesn’t matter if it has a memory of past interactions
- apps that can run on heterogenous (hetero-genius) hardware – aka doesn’t matter if instance jumps around to dif types of hardware
stateless
Each request or task is independent of others. Think short-memory
applicable both in workloads as well as NACL security features
How it works: These workloads do not store information about past requests
NACLs are about network security rules that don’t track previous traffic, while stateless workloads are about applications that don’t remember past actions.
reserved or dedicated capacity
reverse = reserve ahead of time
dedicated = physical EC2 server
What’s included in a EC2 instance outside of it’s processor?
- memory (RAM)
- storage (EBS instance store)
- networking
- security groups
- OS (installed from AMI)
- IAM
- Key pair
- monitoring (cloudwatch)
ways to call AWS via API
management console, SDK, or CLI
What is an instance comprised of?
It includes virtualized hardware (CPU, memory, storage, and networking resources) configured for specific use cases.
= the full virtual machine
dif instance types (ie P5, G5) optimized for different workloads.
Instance vs processor
processor = just one part of the instance. part of the instance’s processor
physical or virtual chip inside the instance responsible for performing computations. Examples include CPUs (e.g., Intel Xeon, AMD EPYC) and GPUs (e.g., NVIDIA H100, H200)
What’s in the P5 and P5e/P5en instances?
P5:
NVIDIA H100 Tensor Core GPUs
P5e/P5en:
NVIDIA H200 Tensor Core GPUs
Intel Sapphire Rapids CPU
Types of CPUs and GPUs
- AMD EPYC
- Intel Xeon (Sapphire, icelake, cascade lake)
Types of savings plans
1 - compute (any type of instance)
2- EC2
3- SageMaker
has committed monthly spend but the flexibility of instance type, geography etc
Reserved instance - what attributes?
need to match the 5 attributes of EC2 - instance type, region, platform, tenancy
multi/shared tenancy
EC2 instances shared on physical servers with other customers
ODCR - On Demand Capacity Reservations
Ability to get capacity at on-demand rates with no commitment
Zonal RI
Provides capacity within a time zone
instance families vs instance types
instance family groups instances by workload optimization (i.e. family ‘t’ or ‘m’ for general purpose), instance type = exact size +resource configuration (i.e. m5.large)