Scaling on Amazon AWS : From the perspective of AWS, and the application stack. Talks about the available options on AWS, and also the architecture of the scalable application.
3. HOW TO DO THIS ON AWS
WHAT IS SCALING ?
THE APPLICATION PERSPECTIVE
Agenda
4. Scaling and scalable architecture
AWS, but a lot also applies to other
cloud providers (Google, Azure)
Ways to do autoscaling and about the
software architecture required
This is about…
6. Add more nodes at an existing pool of
resources
Add more resources to a single node
7.
8. Do It YourselfElastic beanstalkCode deploy
Ways to do this on AWS
Cloud formation
Application
management, build on
EC2, Autoscaling and
Opsworks
A combination of Elastic
Beanstalk, Code
Pipeline,
Cloudformation and
Opsworks
Infrastructure as a
template
11. Cloud watchELBAutoscaling group
Euh, what ?
Attached to 2 autoscaling groups.
Can be external or internal.
2 groups to support rolling code
updates and rollbacks
Metrics used to trigger
autoscaling actions
12. CloudwatchELBAutoscaling group
How does autoscaling work
Loadbalancer, serving
as a HTTP / HTTPS /
TCP endpoint.
Distributes based on
round robin.
Grouped set of
instances in one region,
launched from the
same AMI.
Cloud watch alarms act
as a trigger point for
autoscaling actions.
14. Create a decent health check Pick your autoscaling policy
wisely. Scale up fast, scale
down slow.
Pick decent instance sizes.
Pick sane metrics, metric vs
hits should be linear.
15. • The health check tells the loadbalancer that an instance is ready to accept traffic.
• If it returns OK, but starts returning errors (5xx), or timeouts, the instance is
considered unhealthy and is replaced.
• key metrics :
1. Ping target
2. Timeout
3. Interval
4. Healthy / unhealthy threshold
Health check ?
16.
17. Creating your own AMI’s
•Gives you immutable infrastructure
•Packer build files are JSON, ideal for version control
•Build can be automated in a CI environment
•Bash, Salt Puppet or Chef to compose an image
•Produces images for EC2, Azure, Google Compute, Digital Ocean, Docker, VMWare, VirtualBox
•Single binary, no dependencies
21. MonitorAssume failureBe reactive
Loadbalancer, serving
as a HTTP / HTTPS /
TCP endpoint.
Distributes based on
round robin.
• Isolate all the things
• Act autonomously
• Do one thing, and do it
well
• Go asynchronously
• Gives services a home
address
• Dedicated error
channel
Cloud watch alarms act
as a trigger point for
autoscaling actions.
23. MonitorAssume failureBe reactive
• Isolate all the things
• Act autonomously
• Do one thing, and do it well
• Go asynchronously
• Gives services a home address
• Dedicated error channel
Handle errors gracefully
24. Reactive
•Use a message broker, or pick Akka Cluster
•Always use sane, short timeouts : 0.5 - 1 second is a good default
•Pick a framework that supplies you with the tools to get started
•Use a proper test environment. That’s not your laptop
•Don’t assume consistency. Assume that things are eventually consistent
•If you’re not sure : Guess. If you’re wrong : Apologise and compensate
•Transitions are fine within a microservice. Outside of that, create a reverse action,
so that in every stage, it can be undo, undoing the whole action as such
•Split up read and write in two separate channels