Architecting For The Cloud
Architecting For The Cloud
Architecting For The Cloud
u The AWS infrastructure you provisioned on day-1 may eventually reach a limit
and could crash
u Not knowing what that limit is and when will it be reached is a sure way to hit
a wall
u How can you avoid this?
u Execute load tests
u You should know exactly what type of traffic your applications
can handle with your current AWS infrastructure
u You should know what the customer experience will be, and you
should know at which point things will start to break
u Capacity Planning
u Based on load test results and your growth goals, you should
know well in advance when it’s time to beef up your AWS
infrastructure
u Don’t wait until your customers are having a bad day using your
product. It will be too late!
Mistake #2: Choosing the wrong AWS region 6
u A very common mistake is to choose an AWS region simply based on the
location of your customers
u Not all AWS regions are created equal, there are substantial differences in
price and feature availability
u If you think you’ll use a certain AWS service in the near future, make sure it’s
available in your chosen region
u Some configurations can cost almost double,
depending on the region you choose
u Data transfer in Sao Paolo is 177% more
expensive compared to N. Virginia
u Even within the US, some EC2 instances (like a
t2.large) in N. California will cost you 30%
more compared to N. Virginia
Source: https://www.concurrencylabs.com/blog/choose-your-aws-region-wisely/
Mistake #3: Not Accurately Predicting and Controlling AWS Cost 7
u An application that costs more than it’s worth will eat your profit
u For example, if you are paying $2,000/month for cloud resources for an application
that brings in $1000/month, something is wrong
u Choosing the right instances for your AWS system is a fundamental decision one
needs to confront
u How many instances to choose?
u What’s the right size for an instance?
u How to keep track of all the instances?
u All these are basic yet vital decisions to be made
u AWS pricing is complicated, but not impossible to calculate.
You need to know the type of resources your application
consumes, their quantity and their corresponding AWS price
dimension.
u Example: data transfer (out to the internet, inter-AZ, inter-region), ELB data processed, instance hours,
EBS/S3 storage, billable API calls, Lambda executions and memory, etc. All this must be accounted for!
Mistake #4: Not Designing for Failure 8
u Your team will grow, you’ll have more integrations with other systems,
you’ll use more API keys, you’ll create more IAM Policies, Roles and
Users, you’ll set up more EC2 Security Groups, Network ACLs, you’ll
need to manage more encryption keys and certificates
u If not managed properly, all these things add up
and turn very quickly into a dangerous mess
u Given security is the factor with potentially the
most devastating consequences, you don’t
should not loose sight on security best practices
from day-1 and as you grow
Mistake #8: Don’t Properly Manage Identity, Access and Security 15
u Question: What is one of the most commonly seen and dangerous mistakes
companies make when they use AWS services?
u Answer: Allowing sensitive data stored in S3 buckets to be publicly accessible
u These buckets are secure by default but customers often
loosen these access measures to enable development
u In many cases, they are not re-assigned once
development is complete and the service goes live
u As a result, multiple, very public breaches of S3 security
continually make the news
u AWS administrators need to be sure to grant access to S3
(or any other AWS service) following the principle of “least
privilege” making certain that only those properly trained
and authorized to make changes within S3 have the
access necessary to do so
Source: https://www.threatstack.com/blog/21-infosec-and-aws-experts-reveal-the-1-mistake-companies-make-when-it-comes-to-aws-security-and-how-to-avoid-it
Mistake #9: Don’t do Continuous Integration Continuous Delivery/Deployment 16
u This is another way to guarantee your team won’t scale
u You don’t need to have the most sophisticated workflows in place from
day-1, but you need to at least have a pipeline, which you’ll gradually
upgrade
u Once you start getting more feature requests, bugs, and your codebase
grows, it will be more difficult to implement a good foundation
u With AWS products such as CodeCommit,
CodeBuild, CodeDeploy and CodePipeline,
there’s really no excuse for postponing at
least some basic code automation
Mistake #10: Avoiding Monitoring and Metrics 17
u “You can’t manage what you can’t measure” is extremely important here
u Not having visibility on important metrics is a recipe for disaster
u Consider measuring for following categories:
u Business Metrics - They tell you if you’re still making money (or not). They measure
in real time your performance against business goals and objectives.
u Customer Experience Metrics - They tell you what
your customers see, if they’re having a good day
using your application (or not). They reflect
“symptoms” when things are not going well.
u System Metrics - They tell you the root causes
behind Customer Experience metrics. They also tell
you if your systems are healthy, at risk, or already
creating a bad experience for your customers.
Source: https://iaasacademy.com/aws-certified-sysops-administrator-associate-exam/monitoring-metrics-exam-tips-amazon-s3/
Mistake #10: Avoiding Monitoring and Metrics 18
How fast is the
application
responding?
u Business Metrics
How high is u Examples: Revenue from application (e.g.
What’s the
the CPU %?
memory
orders submitted) vs. how much this all costs
utilization? to run in the cloud
u You can configure alarm actions to stop, start, or terminate an Amazon EC2
instance when certain criteria are met
u In addition, you can create alarms that initiate Amazon EC2 Auto-Scaling
and Amazon Simple Notification Service (Amazon SNS) actions on your behalf
CloudWatch – Dashboard Example 25
CloudWatch – Alarm Actions Example 26
u Assume we have set up an alarm for an EC2 Instance…