Designing for elasticity on AWS - 9.11.2015

25
Designing For Elasticity On AWS November 9th, 2015 - CSA Meetup Oslo

Transcript of Designing for elasticity on AWS - 9.11.2015

Page 1: Designing for elasticity on AWS - 9.11.2015

Designing For Elasticity On AWS

November 9th, 2015 - CSA Meetup Oslo

Page 2: Designing for elasticity on AWS - 9.11.2015

Who am I?

Anton Babenko

Sr. Software Engineer at Telenor DigitalActive user of AWS since 2010. Organizer of AWS User Group Norway meetup.

Before:Web-developer, consultant and tech lead for the last 10 years.Zoozoo.com, mCash, SnappOrder, and many more.

E-mail: [email protected]: https://www.linkedin.com/in/antonbabenko Github: http://github.com/antonbabenko

Page 3: Designing for elasticity on AWS - 9.11.2015

Agenda:

1) AWS and Elasticity2) Application layer3) AWS Services

Page 4: Designing for elasticity on AWS - 9.11.2015

What is AWS?

Page 5: Designing for elasticity on AWS - 9.11.2015

What is AWS?

• Low infrastructure cost• No guesses and planning upfront required• Unlimited scalability• Highly reliable

Page 6: Designing for elasticity on AWS - 9.11.2015

What is AWS?

Scalability, Security, High-availability, Testability, Fault-tolerance and Elasticity are configurable properties of the AWS platform on which application is running.

Page 7: Designing for elasticity on AWS - 9.11.2015

What does elasticity mean?

Page 8: Designing for elasticity on AWS - 9.11.2015

How designing for cloud is different?

The cloud changes several processes, patterns, practices, philosophies and reinforces some traditional service-oriented architectural principles that you have learnt as they are even more important than before.

Page 9: Designing for elasticity on AWS - 9.11.2015

How designing for cloud is different?

The cloud reinforces SOA principles:• Service loose coupling• Service abstraction• Service reusability• Service autonomy• Service statelessness• Service discoverability• ...

Page 10: Designing for elasticity on AWS - 9.11.2015

How designing for cloud is different?

The cloud brings some new philosophies:• Building scalable architectures• Understanding elasticity• Not fearing constraints

Page 11: Designing for elasticity on AWS - 9.11.2015

How designing for AWS is different?

• Not fearing constraints = “be creative in AWS-way”• “Design for failure and nothing fails”

SOA principles reinforced:• Service loose coupling - all• Service reusability - EC2, S3, Route53• Service discoverability - AS, tagging• ...

Page 12: Designing for elasticity on AWS - 9.11.2015

How to make app to get most of AWS in term of elasticity?

Page 13: Designing for elasticity on AWS - 9.11.2015

App should be scalable to be able to utilize cloud advantages fully.

Page 14: Designing for elasticity on AWS - 9.11.2015

What about web app ?

Web applications must be:1) Stateless2) Loosely coupled3) Able to scale horizontally

Advices:• Think parallel• Leverage different storage options• Automate everything

Read 12factor by Heroku.

Page 15: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Page 16: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Use Elastic Load Balancer:• Not free, but cheaper than your managed HAProxy (ELB

costs $0.028 pr. hour = $245 pr year)

https://aws.amazon.com/elasticloadbalancing/

Page 17: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Use Auto Scaling:• Free• Optionally combine with ELB

https://aws.amazon.com/autoscaling/

Page 18: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Monitor what is going on using standard Cloudwatch metricsor add custom metrics.

• Dashboard (new!)

https://aws.amazon.com/cloudwatch/

Page 19: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Use dynamic configuration to bootstrap instances:• SimpleDB or DynamoDB can keep configurations, for example

https://aws.amazon.com/simpledb/ https://aws.amazon.com/dynamodb/

Page 20: Designing for elasticity on AWS - 9.11.2015

How to implement elasticity on AWS?

Automate everything:• Cloudformation• AWS CLI• Terraform by Hashicorp• …

https://aws.amazon.com/cloudformation/https://aws.amazon.com/cli/ https://www.terraform.io/

Page 21: Designing for elasticity on AWS - 9.11.2015

How to get most of AWS?

1) Use free tier2) Use Route533) Use Cloudfront4) Experiment with instance types5) Decide which pricing model fits your needs best6) Use latest AMI and latest instance types7) Read

A Comprehensive Guide to Building a Scalable Web App on Amazon Web Services

8) Browse Cloud Design Pattern

Page 22: Designing for elasticity on AWS - 9.11.2015

Are you well-architected?

AWS Well-Architected Framework

• Security• Reliability• Performance efficiency• Cost Optimization

Page 23: Designing for elasticity on AWS - 9.11.2015

Questions ?

Thank you!

Page 24: Designing for elasticity on AWS - 9.11.2015

We are hiring!

Page 25: Designing for elasticity on AWS - 9.11.2015

Credits:

https://sdqweb.ipd.kit.edu/publications/pdfs/HeKoRe2013-ICAC-Elasticity.pdfhttp://en.wikipedia.org/wiki/Service-oriented_architecturehttps://www.airpair.com/aws/posts/building-a-scalable-web-app-on-amazon-web-services-p1http://en.clouddesignpattern.org/ http://aws.amazon.com/architecture/http://d0.awsstatic.com/whitepapers/architecture/AWS_Well-Architected_Framework.pdf