Other Compute Services
Docker
-
Docker is a software development platform to deploy applications
-
Apps are packaged in containers that can be run on any OS
-
Apps run the same, regardless of platform
- Any machine
- No compatibility issues
- Predictable behaviour
- Less work
- Easier to maintain and deploy
- Works with any language, OS and technology
-
Containers can be scaled vertically in seconds
-
Docker images are stored in Docker Repositories
- Public: Docker Hub
- Provides many base images for technologies or OS (Ubuntu, MySQL, Node.js, Java...)
- Private: Amazon ECR (Elastic Container Registry)
- Public: Docker Hub
-
Use Docker or Virtual Machines
- Docker is not quite a virtualisation technology
- Resources are shared with the host, allowing many containers on one server
- VM architecture: Infrastructure --> Host OS --> Hypervisor --> Many apps on a Guest OS (VM) on EC2 instances
- Docker architecture: Infrastructure --> Host OS (EC2 Instance) --> Docker Daemon --> Many containers
ECS
Elastic Container Service: A service used to launch Docker containers on AWS
- Must provision and maintain the infrastructure yourself, create EC2 instances beforehand
- AWS takes care of starting / stopping containers
- Integrated with the Application Load Balancer
Fargate
- A service to also launch Docker containers on AWS, but, you do not need to provision the infrastructure
- Serverless
- AWS just runs containers for you based on the CPU / RAM you need
ECR
- Elastic Container Registry: A 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
-
Initially, serverless was function as a service (FaaS)
-
Pioneered by AWS Lambda but now includes any service that's managed, such as databases, messaging, storage, etc.
-
Serverless does not mean there are no servers, it just means you don't have to manage / provision them
-
Why use AWS Lambda?
- EC2:
- Virtual servers in the Cloud
- Limited by RAM and CPU
- Continuously running
- Scaling means intervention to add / remove servers
- Lambda:
- Virtual functions, no servers to manage
- Limited by time, short executions
- Run on-demand
- Automated scaling
- EC2:
-
Benefits of AWS Lambda:
- Pay per request and compute time, free tier of one million AWS Lambda requests and 400,000 GBs of compute time
- $0.20 per million requests after the initial million free requests (requests)
- $1.00 for 600,000 GBs (duration)
- Integrated with the whole AWS suite of services
- Event-Driven: Functions get invoked by AWS when needed
- Integrated with many programming languages:
- Node.js
- Python
- Java
- C#
- Golang
- Ruby
- Custom Runtime API
- Lambda Container Image (container image must implement the Lambda Runtime API)
- ECS / Fargate is preferred for running arbitrary Docker images
- Easy to monitor through AWS CloudWatch
- Easy to get more resources per functions (up to 10 GB of RAM, increasing RAM will improve the CPU and network)
- Pay per request and compute time, free tier of one million AWS Lambda requests and 400,000 GBs of compute time
Amazon API Gateway
- A fully managed service for developers to easily create, publish, maintain, monitor and secure APIs
- Serverless and scalable
- Supports RESTful APIs and WebSocket APIs
- Support for security, user authentication, API throttling, API keys, monitoring
AWS Batch
-
Fully managed batch processing at any scale
-
A batch job is a job with a start and end (not continuous)
-
Efficiently run 100,000s of computing batch jobs on AWS
-
Batch will dynamically launch EC2 instances or Spot Instances
-
Batch provisions the compute / memory
-
The user only submits or schedules batch jobs
-
Batch jobs are defined as Docker images and run on ECS
-
Good for cost optimisations and focusing less on infrastructure
-
Batch vs. Lambda:
- Lambda:
- Time limit
- Limited runtimes (few programming languages)
- Limited temporary disk space
- Serverless
- Batch:
- No time limit
- Any runtime as long as it's packaged as a Docker image
- Rely on EBS / instance store for disk space
- Relies on EC2 (can be managed by AWS)
- Lambda:
Amazon Lightsail
- A bit of a standalone service providing virtual servers, storage, databases and networking
- Low and predictable pricing
- Simpler alternative to using EC2, RDS, ELB, EBS, Route 53
- Good for people with little cloud experience
- Can setup notifications and monitoring for your Lightsail resources
- Use cases: Simple web apps, websites, dev / test environment
- High availability but no auto-scaling, limited AWS integrations