Overview of MySQL EBS Setups

Overview

mysql_ebs_diagram.gifThe advantage of using EBS Volumes for setting up a master/slave database on EC2 is that it’s a more efficient way of storing data on EC2 servers, particularly databases.  With EBS, backups (snapshots) are no longer performed by the instance. Since the local CPU is no longer involved, performing backups will have less affect on an application's performance. The time needed to freeze a volume and take a snapshot is much shorter than creating a large .tar file.  Snapshots also provide a more efficient way of storing data and backups, because the data blocks for snapshots are incrementally saved to S3.   For more information, see Elastic Block Store (EBS).

The important thing to remember about using EBS for setting up a failover MySQL database on EC2 is that all restores are done through snapshots (backups).  Also, when a server crashes, any attached volumes are automatically detached and deleted.  

EBS Volumes and Snapshots

One of the key concepts to understand about the MySQL-EBS Database setup is that backups of the MySQL DB are saved as EBS snapshots.  EBS volumes are created from a snapshot and are attached to a master/slave instance.  When a MySQL server is terminated, the EBS volume is automatically detached and deleted.   Therefore, all DB restorations are done using snapshots.  Whereas volumes are not persistent, snapshots can be archived and  help protect your data from being lost.  Snapshots also make it easy to launch servers and populate the databases since the template will use the most recently saved snapshot (regardless of whether it's a master/slave) to restore a MySQL database.  If you are setting up a MySQL-EBS deployment for the first time, a few extra steps are required in order to create the first snapshot.  Once you have a snapshot, you can launch and deploy MySQL DB servers in a single step.  

NOTE: A new snapshot will automatically be created once a new master/slave DB is launched or when a Slave-DB is promoted to master.

 

What’s the difference between non-EBS and EBS MySQL Database Setups?

Below is a table that summarizes some of the core differences between these two types of setups.

Specification
non-EBS
EBS
 Storage of Database Backups Saved as .tar files to S3 Saved as EBS Snapshots to S3
 Initialization of Slave-DB Grabs data using rsync, directly from the Master-DB Launched from a snapshot of the the Master-DB
 Backups of Master-DB Daily backups Continuous backups
(The last 10 are saved)
 Backups of Slave-DB Continuous backups of the slave every 10 min.
(The last 10 are saved)
Continuous backups of the slave every 10 min.
(The last 10 are saved)
 ServerTemplates MySQL Bootstrap, MySQL Additional MySQL EBS
 Database Recovery Time Can be very slow for large databases Faster than non-EBS

 

Tag page
You must login to post a comment.