4

I am new to AWS and I have a growing website that is connected to many APIs and I have a growing database and I just don't want to reach a point where my system crashes.

So I have:

  1. Website
  2. Inside the website, there is an application which connects to a large database, it sorts the information first and then redirects the customer to a processing page which will connect to 10 APIs
  3. An admin panel where you can re-run all applications or send further request to APIs

Now my question is: Is it better to have the database in same EC2 server or it is better if I have it separately on RDS?

What is the best for my growing project?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
marvillous
  • 131
  • 1
  • 7

3 Answers3

6

First, offloading DB away from your main Website instance has it advantages. You can benchmark separate entities and decide which one to scale.

for 24x7 services, use RDS for your DB. You can create automatic fail-over recovery easily (though still need a bit of intervention) in the future. And you can create a DB snapshot backup independently from your main apps.

If you only need the services every fortnight and data recovery is not crucial, put RDB in EC2 might save you some bucks. (Update) : Now AWS let you temporary "STOP" the RDS database and start it on demand server, however, RDS will automatically start after 7 days. If you use an expensive RDS instance on demands, make sure you set up notification to handle such situation.

Second, when you offloading RDB away from your apps server, you will get an extra flexibility to load balance your website. You have a choice of using ELB or even SPOT-instance.

For new admin, setting up AWS EC2 RDBMS with SSD driver (e.g. m3.large 2x32GB SSD) is very tempting, since you don't need to deal with EBS IOPS tuning, the ephemeral SSD drive will give you maximum IOPS associated with that SSD. However, you can't expand the SSD. For RDS, you use EBS, when you face of IOPS bottleneck, you can either scale up the disk space to get more IOPS , or provision extra IOPS.

mootmoot
  • 12,845
  • 5
  • 47
  • 44
  • Thanks a lot for your advice. I will keep this question open and see other opinions as will, I think everyone will agree this, I just want to have more ideas .. thanka a lot – marvillous Nov 02 '16 at 13:50
3

You should design your AWS setup to be ephemeral, EC2 instances should be able to be removed without impacting your site. This would be in contrast to hosting your database directly on the EC2 instance, so in short you should absolutely use RDS.

Stefan
  • 2,961
  • 1
  • 22
  • 34
  • Agreed. You should be able to rebuild your application server without causing loss of data. Also, as usage increases, you will be able to horizontally scale your application without impacting the data store. – John Rotenstein Nov 02 '16 at 21:13
1
  1. Use a separate server for your Database, from this thread:

    Scalability. Keeping your web server stateless allows you to scale your web servers horizontally pretty much effortlessly. It is very difficult to horizontally scale a database server.

  2. Unless you have very specific needs (e.g.: ssh access to the Database instance), Amazon RDS is almost always better than self-managing a Database host. The Amazon RDS Product Page has a comprehensive features list.
    TL;DR With Amazon RDS you automatically get:

    • backups
    • point-in-time restores
    • failover (with Multi-AZ)
    • software patching
    • monitoring and alerting
Community
  • 1
  • 1
Simone Lusenti
  • 546
  • 5
  • 7