A Beginner's Guide to Scaling to 11M+ Users on Amazon's AWS (2016)

downbad_1 pts0 comments

A Beginner's Guide to Scaling to 11 Million+ Users on Amazon's AWS - High Scalability -

Sign in<br>Subscribe

How do you scale a system from one user to more than 11 million users? Joel Williams, Amazon Web Services Solutions Architect, gives an excellent talk on just that subject: AWS re:Invent 2015 Scaling Up to Your First 10 Million Users.<br>If you are an advanced AWS user this talk is not for you, but it’s a great way to get started if you are new to AWS, new to the cloud, or if you haven’t kept up with with constant stream of new features Amazon keeps pumping out.<br>As you might expect since this is a talk by Amazon that Amazon services are always front and center as the solution to any problem. Their platform play is impressive and instructive. It's obvious by how the pieces all fit together Amazon has done a great job of mapping out what users need and then making sure they have a product in that space.<br>Some of the interesting takeaways:<br>Start with SQL and only move to NoSQL when necessary.<br>A consistent theme is take components and separate them out. This allows those components to scale and fail independently. It applies to breaking up tiers and creating microservices.<br>Only invest in tasks that differentiate you as a business, don't reinvent the wheel.<br>Scalability and redundancy are not two separate concepts, you can often do both at the same time.<br>There's no mention of costs. That would be a good addition to the talk as that is one of the major criticisms of AWS solutions.<br>The Basics

AWS is in 12 regions around the world.

A Region is a physical location in the world where Amazon has multiple Availability Zones. There are regions in: North America; South America; Europe; Middle East; Africa; Asia Pacific.

An Availability Zone (AZ) is generally a single datacenter, though they can be constructed out of multiple datacenters.

Each AZ is separate enough that they have separate power and Internet connectivity.

The only connection between AZs is a low latency network. AZs can be 5 or 15 miles apart, for example. The network is fast enough that your application can act like all AZs are in the same datacenter.

Each Region has at least two Availability Zones. There are 32 AZs total.

Using AZs it’s possible to create a high availability architecture for your application.

At least 9 more Availability Zones and 4 more Regions are coming in 2016.

AWS has 53 edge locations around the world.

Edge locations are used by CloudFront, Amazon’s Content Distribution Network (CDN) and Route53, Amazon’s managed DNS server.

Edge locations enable users to access content with a very low latency no matter where they are in the world.

Building Block Services

AWS has created a number of services that use multiple AZs internally to be highly available and fault tolerant. Here is a list of what services are available where.

You can use these services in your application, for a fee, without having to worry about making them highly available yourself.

Some services that exist within an AZ: CloudFront, Route 53, S3, DynamoDB, Elastic Load Balancing, EFS, Lambda, SQS, SNS, SES, SWF.

A highly available architecture can be created using services even though they exist within a single AZ.

1 User

In this scenario you are the only user and you want to get a website running.

Your architecture will look something like:

Run on a single instance, maybe a type t2.micro. Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications.

The one instance would run the entire web stack, for example: web app, database, management, etc.

Use Amazon Route 53 for the DNS.

Attach a single Elastic IP address to the instance.

Works great, for a while.

Vertical Scaling<br>You need a bigger box. Simplest approach to scaling is choose a larger instance type. Maybe a c4.8xlarge or m3.2xlarge, for example.<br>This approach is called vertical scaling.<br>Just stop your instance and choose a new instance type and you’re running with more power.<br>There is a wide mix of different hardware configurations to choose from. You can have a system with 244 gigs of RAM (2TB of RAM types are coming soon). Or one with 40 cores. There are High I/O instances, High CPU Instances, High storage instances.<br>Some Amazon services come with a Provisioned IOPS option to guarantee performance. The idea is you can perhaps use a smaller instance type for your service and make use of Amazon services like DynamoDB that can deliver scalable services so you don’t have to.<br>Vertical scaling has a big problem: there’s no failover, no redundancy. If the instance has a problem your website will die. All your eggs are in one basket.<br>Eventually a single instances can only get so big. You need to do something else.<br>Users > 10

Separate out a single host into multiple hosts

One host for the web site.

One host for the database. Run any database you want, but you are on...

amazon services instance scaling users single

Related Articles