Should I use EBS or S3 to store my database?

I want to host a website on an instance of Amazon EC2, but for reliability reasons, I want to have a basic database on some more permanent media. There will be no file downloads or anything like that, but I want database queries and updates to be fast. Should I use EBS or S3 for this?

And just a comment if you want more information

+6
source share
3 answers

You cannot store the database on S3. If you are going to store your database anywhere, it will be either in EBS or in the instance repository.

+6
source

Like, @Femi said, you cannot use S3 for the database, but you can use one of these storage instances / EBS / RDS. Further information below:

Instance store will disappear if your instance is crashed, + EBS volume got quite a good problem recently - though this is good over instance-store, I would suggest you to have a look at Amazon RDS, I had used it for one my project and it super cool.

Amazon RDS has some nice advantages:

http://aws.amazon.com/rds/

Features:

  • Automatic backup
  • DB Snapshots
  • Auto Host Replacement
  • Replication

When you compare EBS with RDS, both are charged where they are slightly less than RDS compared to EBS, but it costs. Amazon takes care of everything, and if your site is traffic-driven, it has a solution for automatic replication.

+2
source

Just to build on other very good answers, you can store your database as a .sql file on s3. But your site / application cannot make requests to this file, because s3 does not have a MySQL program (file! = Database).

Amazon RDS stores backups of your s3 database as .sql files (I assume) that they programmatically retrieve and use to restore your RDS database instance if it fails.

The advantages of EBS and RDS are indicated in other answers, but in order to be clear, the key advantage of RDS is that Amazon will take care of restoring the failed instance by providing backups, etc.

I am not sure about the replication of the database, although it seems to be a separate concept, and I read that this is NOT a RDS function. More experienced database administrators seem to often point this out as a reason NOT to use RDS. Can someone clarify this?

+1
source

Source: https://habr.com/ru/post/890171/


All Articles