Scaling on AWS for the First 10 Million Users (ARC206) | AWS re:Invent 2013

Cloud computing gives you a number of advantages in being able to scale on demand, easily replace whole parts of your infrastructure, and much more. As a new business looking to use the cloud, you
…

Cloud computing gives you a number of advantages in being able to scale on demand, easily replace whole parts of your infrastructure, and much more. As a new business looking to use the cloud, you inevitably ask yourself, Where do I start? Join us at this session to understand some of the common patterns and recommended areas of focus you can expect to work through while scaling an infrastructure to handle going from zero to millions of users. From leveraging highly scalable AWS services to making smart decisions on building out your application, you'll learn a number of best practices for scaling your infrastructure in the cloud. The patterns and practices reviewed in this session will get you there.

19.
Day One, User One
• We could potentially get
to a few hundred to a few
thousand depending on
application complexity
and traffic
• No failover
• No redundancy
• Too many eggs in one
basket
Amazon
Route 53
User
Elastic IP
EC2
Instance

20.
Day One, User One:
• We could potentially get
to a few hundred to a few
thousand depending on
application complexity
and traffic
• No failover
• No redundancy
• Too many eggs in one
basket
Amazon
Route 53
User
Elastic IP
EC2
Instance

43.
ElastiCache
•
•
•
•
•
•
•
Hosted Memcached & Redis
– Speaks same API as traditional open source
Memcached and Redis
Scale from one to many nodes
Self-healing ( replaces dead instance )
Very fast ( single digit ms speeds usually )
Local to a single AZ for Memcache, with no persistence or
replication
With Redis can put a replica in a different AZ with
persistence
Use AWS’s Auto Discovery client to simplify clusters
growing and shrinking without affecting your application

44.
Now that our Web tier is
much more lightweight, we
can revisit the beginning of
our talk…

61.
Spend Your Time Wisely
Managing your infrastructure will become an
increasingly important part of your time. Use tools to
automate repetitive tasks
• Tools to manage AWS resources
• Tools to manage software on and configuration of
your instances
• Automated data analysis of logs and user actions

63.
Host-based Configuration Management
Two big players
– Opscode Chef
– PuppetLabs Puppet
•
•
•
•
•
Both do more or less the same thing
They have similar syntax
Works well with tools from the previous slide
Require some learning time
Can’t scale easily without this kind of capability

67.
SOAing
Move services into their own tiers
or modules. Treat each of these
as 100% separate pieces of your
infrastructure and scale them
independently.
Amazon.com and AWS do this
extensively! It offers flexibility and
greater understanding of each
component.

81.
From 5 to 10 Million Users
You may start to run into issues with your database around
contention on the write master.
How can you solve it?
• Federation (splitting into multiple DBs based on function)
• Sharding (splitting one data set up across multiple hosts)
• Moving some functionality to other types of DBs (NoSQL)

82.
Database Federation
• Split up databases by function
or purpose
• Harder to do cross-function
queries
• Essentially delays the need for
something like sharding or
NoSQL until much further down
the line
• Won’t help with single huge
functions or tables
ForumsDB
UsersDB
ProductsDB

85.
From 5 to 10 Million Users
You may start to run into issues with speed and performance
of your applications
• Make sure you have monitoring, metrics, & logging in place
– If you can’t build it internally, outsource it! (third-party SaaS)
• Pay attention to what customers are saying works well vs.
what doesn’t, and use this as direction
• Try to work on squeezing as much performance out of each
service or component