Other Compute Services Flashcards
What is Docker?
• Docker is a software development platform to deploy apps
• Apps are packaged in containers that can be run on any OS
• Apps run the same, regardless of where they’re run
• Scale containers up and down very quickly (seconds)
Where are Docker images stored?
• Docker images are stored in Docker Repositories
Docker versus Virtual Machines
• Docker is ”sort of” a virtualization technology, but not exactly
• Resources are shared with the host => many containers on one server
• VM emulates machine hardware whereas Docker emulates the operating system in which your application runs.
Elastic Container Service (ECS)
Is a fully managed container orchestration service that makes it easy for you to deploy, manage, and scale containerized applications.
• You must provision & maintain the infrastructure (the EC2 instances)
• AWS takes care of starting / stopping containers
Fargate
Fargate is a “serverless” way to run your ECS/EKS containers in a cluster. AWS manages the underlying host, which means you don’t have to think about patching, scaling, or securing of the host.
• AWS just runs containers for you based on the CPU / RAM you need
Elastic Container Registry (ECR)
• Private Docker Registry on AWS
• This is where you store your Docker images so they can be run by ECS or Fargate
What’s serverless?
• Serverless is a new paradigm in which the developers don’t have to manage servers anymore…
• They just deploy code
• They just deploy… functions
• Serverless does not mean there are no servers…
Some of the serverless services in AWS
• S3
• DynamoDB
• Fargate
• Lambda
Why AWS Lambda
• No servers to manage!
• Limited by time - short executions
• Run on-demand
• Scaling is automated!
Benefits of AWS Lambda
• Pay per request and compute time (Calls and Duration)
• Integrated with the whole AWS suite of services
• Event-Driven: functions get invoked by AWS when needed
• Can scale from a single request to hundreds of thousands per second.
• Integrated with many programming languages
• Easy to get more resources per functions (up to 10GB of RAM!)
AWS Lambda language support
• Node.js (JavaScript)
• Python
• Java (Java 8 compatible)
• C# (.NET Core)
• C# / Powershell
• Ruby
Lambda Container Image
Is a package that includes the Lambda Runtime API, necessary dependencies, an operating system, and function handlers required to run Docker containers in AWS Lambda.
• These packages allow development teams to deploy and execute arbitrary code and libraries into the Lambda runtime.
• ECS / Fargate is preferred for running arbitrary Docker images
Example: Serverless Thumbnail creation
New image in S3 > Trigger > AWS Lambda Function (Creates a Thumbnail) > Push > New thumbnail in S3
Example: Serverless CRON Job
CloudWatch Events EventBridge > Trigger Every 1 hour > AWS Lambda Function (Perform a task)
Amazon API Gateway
• Example: building a serverless API
• Fully managed service for developers to easily create, publish, maintain, monitor, and secure APIs
• Scalable
• Supports RESTful APIs and WebSocket APIs
• Support for security, user authentication, API throttling, API keys, monitoring…