1

I have a link sharing site (think reddit). It is hosted on godaddy deluxe shared hosting now. I am planning to migrate it to aws.

I have seen an aws webinar on scaling till 10 million users. But basically it just says beyond an extent you can't scale in a vertical manner so choose to scale in a horizontal manner from the beginning itself.

I don't need to support 10 million users. Assume that i need to support 100,000 users daily. At most the site will have say 1000 concurrent users.

Use Case

  • Users will post links to the site. Only one in 1000 users will post links.
  • Most users just search the site for links, read the description etc.
  • About 5000 comments will be made on the site every day.
  • It is mainly a text based site.
  • There are very little images on the site except user avatar and banner, both of which are limited at 2MB. The images are stored in the DB.
  • usual features of a forum like signup,login, account etc are present.

Planned Architecture

  • 1 EC2 instance
  • 1 RDS instance
  • 1 Route 53 Zone
  • 1 Elastic ip
  • 1 s3 (only for backup)

I plan to scale using this simple method - Start with say t2.micro, as the user base grows simply upgrade the ec2 instance. The same goes for the RDS instances.

I know that 1 EC2 or RDS makes it a single point of failure. If any of these break i plan to terminate that instance and start an identical one from an image/backup. I am okay if the site is offline for 1 hour every 30 days.

Please keep in mind that i have no one to assist me and this is a solo effort. I can find someone to assist on the aws side if it hits users.

  1. Can i support 100,000 users in this manner?
  2. At what breakpoints should i upgrade to the next Ec2 instance till the 100,000 users/1000 concurrent users? (eg. Till 5 concurrent users- t2.micro/db.t2.micro, Till 40 concurrent users- EC2 Instance type 2/Rds instance type 2 etc.)
  3. Is there anything else that i have not considered/ have to consider before going ahead with this plan?
nandu kk
  • 111
  • 2
  • You need to benchmark your software. You should also consider reliability - you're better off with two smaller servers (one in each AZ) including multi-AZ RDS than one large server. You can start with one server then move to a load balancer and two servers when you have sufficient load. Make sure caching headers are set correctly and use a CDN to offload pages where appropriate. Use S3 for static content. – Tim Mar 13 '18 at 18:38

1 Answers1

0

It's very difficult to say if a web application will handle X number of clients on a particular system. It's heavily depends on many factors including how the application was written, frameworks used etc.

The best option would be to find something you can use to benchmark/simulate usage of the application. As you already seem to have the web application running you could easily set up any size ec2 instance for a short amount of time, run some tests, then shut it down.

Being able to scale horizontally will provide a much better route for handling growth in the future. What happens if the site struggles on the larger instances, or you need to scale past 100,000? You may also find that just moving to bigger instances will likely not return a linear increase in performance.

One thing that does stand out -

The images are stored in the DB.

Store the images, and anything else that you don't specifically need application servers to handle somewhere else. As you're already using an AWS stack, S3 is the obvious place for images and other static data. Don't waste application server time on static resources.

USD Matt
  • 5,321
  • 14
  • 23
  • I admit that eventually horizontal scaling is the way to go. My question is weather or not to do it from day one. Can't i just max out the vertical scaling option and then move to a horizontal architecture? While it is possible that it may one day grow beyond 100,000 users, what if 100k users is all that the site is ever going to have? I am just trying to avoid dealing with additional overhead and maintenance based on the assumed user growth. – nandu kk Mar 13 '18 at 16:26
  • You can always move to horizontal, a lot of sites have done that. It's just that it could involve a complete re-architecture of the application, and so if it's likely, it's worth at least taking into consideration during the initial build. – USD Matt Mar 13 '18 at 16:31
  • While it is mainly a text based site and images are very few, on second thought using s3 for images is the way to go. If 10K users have avatar and banner, that itself is 4GB of images. I will take your advice on this. – nandu kk Mar 13 '18 at 16:31