Aurora vs MySQL
| Criteria | MySQL | Aurora |
|---|---|---|
| Security | Secure | Secure |
| Scalability | Need to scale manually | Auto Scalable |
| Performance | Provides 1,000–40,000 IOPS for MySQL | Performs 5 times better than RDS |
| High Availabilty | Highly Available | Highly Available |
| Fault Taulrance | Multi Availability zone | If the primary instance in a DB cluster using single-master replication fails, Aurora automatically fails over to a new primary instance in one of two ways: By promoting an existing Aurora Replica to the new primary instance By creating a new primary instance |
| Cost Effective | Need to pay for some resources before hand such as storage as currently we are paying for 1 TB storage but not using all of it. | Pay only for the database resources you consume, on a per-second basis. Need not to pay for the database instance unless it's actually running |
| Capacity Planning | size of a table to a maximum size of 16 TB when using InnoDB file-per-table table spaces | there is no need for capacity planning. Aurora storage will automatically grow,from the minimum of 10 GB up to 64 TB so it is not possible to predict the maximum number of rows in one table as this depends on multiple factors such as no. of columns in a table,data type and many others |
| Backup & Restore | By default, Amazon RDS creates and saves automated backups of your DB instance securely in Amazon S3 for a user-specified retention period. In addition, you can create snapshots, which are user-initiated backups of your instance that are kept until you explicitly delete them. | Automated backups are always enabled on Amazon Aurora DB Instances. Backups do not impact database performance. |
| ACUs | Memory (GB) | Serverless/hr | Instance Type | Cost/hr | Diff/hour | Diff/month |
|---|---|---|---|---|---|---|
| ACUs | Memory (GB) | Serverless/hr | Instance Type | Cost/hr | Diff/hour | Diff/month |
| 1 | 2 | $0.06 | db.t2.small | $0.041 | $0.019 | $13.68 |
| 2 | 4 | $0.12 | db.t2.medium | $0.082 | $0.038 | $27.36 |
| 8 | 16 | $0.48 | db.r4.large | $0.29 | $0.190 | $136.80 |
| 16 | 32 | $0.96 | db.r4.xlarge | $0.58 | $0.38 | $273.60 |
| 32 | 64 | $1.92 | db.r4.2xlarge | $1.16 | $0.76 | $547.20 |
| 64 | 122 | $3.84 | db.r4.4xlarge | $2.32 | $1.52 | $1,094.40 |
| 128 | 244 | $7.68 | db.r4.8xlarge | $4.64 | $3.04 | $2,188.80 |
| 256 | 488 | $15.36 | db.r4.16xlarge | $9.28 | $6.08 | $4,377.60 |
Aurora Serverless Auto-Scaling:
Aurora Serverless is currently only available for MySQL 5.6. You basically have to set the minimum and maximum capacity unit for the DB cluster. Each capacity unit is equivalent to a specific compute and memory configuration. Aurora Serverless reduces the resources for the DB cluster when its workload is below these thresholds. Aurora Serverless can reduce capacity down to the minimum or increase capacity to maximum capacity unit.
The cluster will automatically scale up if either of the following conditions are met:
- CPU utilization is above 70% OR
- More than 90% of connections are being used
The cluster will automatically scale down if both of the following conditions are met:
- CPU utilization drops below 30% AND
- Less than 40% of connections are being used
Cool down Period:
- It only scales up when it detects performance issues that can be resolved by scaling up.
- After scaling up, the cool down period for scaling down is 15 minutes.
- After scaling down, the cool down period for the next scaling down again is 310 seconds.
- It scales to zero capacity when there are no connections for a 5-minute period.
- By default, Aurora Serverless performs the automatic scaling seamlessly, without cutting off any active database connections to the server. It is capable of determining a scaling point (a point in time at which the database can safely initiate the scaling operation). Under the following conditions, however, Aurora Serverless might not be able to find a scaling point:
- Long-running queries or transactions are in progress.
- Temporary tables or table locks are in use.
- If either of the above cases happens, Aurora Serverless continues to try to find a scaling point so that it can initiate the scaling operation (unless "Force Scaling" is enabled). It does this for as long as it determines that the DB cluster should be scaled.
Aurora Version: Aurora MySQL 2.07.0 is wire-compatible with MySQL 5.7 which is the current MySQL version we are using.
Impact:
- Change in source code: There will be no change in existing code as Amazon aurora compatible with MySQL platform.Only database endpoint will change as per aws documentation(Existing code compatibility will be verified in POC part).
- Performance Impact on CFU Purging: Performance impact on CFU purging activity will be covered in POC part by performing archiving and purging complete one month data on newly created Amazon aurora instance.
- Cost: As mentioned above, there is a major impact in costing.
- Migration with zero downtime: This will covered as the part of POC on non-prod environment by launching Aurora MySQL Read Replica
- Performance: Aurora DB is available in two flavors, Aurora RDS vs Aurora Serverless. Aurora serverless provides seamless scaling options when the load on the database increases which in turn increases the performance of the database under heavy load. A detailed comparison of Aurora RDS vs Aurora serverless is given below.
- Scalability: The scalability options in Aurora RDS remains same as MySQL RDS on the other hand Aurora Serverless can auto scale DB in case of heavy load and scale down during less traffic.
Ways for Migration:
- Using the Talend Extract-Transform-Load (ETL) tool: Integrate Talend with Aurora and migrate data into the Aurora DB cluster.
- Using MySQL dump: Create a MySQL data dump using the
mysqldumputility and import it into the Aurora DB cluster. - Using an Amazon RDS MySQL DB snapshot: Create a DB snapshot of an Amazon RDS MySQL DB instance and migrate it to the Aurora DB cluster.
- Using Amazon AWS Database Migration Service (AWS DMS): Connect AWS DMS with MySQL and migrate data from MySQL to the Aurora DB cluster.
Migration strategy:
Strategy 1:
Migrate data directly from an Amazon RDS MySQL DB snapshot to an Amazon Aurora MySQL Database cluster.
Migrate data directly from an Amazon RDS MySQL DB snapshot to an Amazon Aurora MySQL Database cluster.
If we go for the migration via Database snapshot there might be inconsistencies in data as it will take some time to restore the snapshot on Amazon aurora instance. The data will not be in sync with our current database owing to the fact that the snapshot will take some time to be restored in Amazon Aurora instance, causing a considerable downtime while migrating database from RDS MySQL to Amazon aurora.
Strategy 2:
Migrate from an RDS MySQL DB instance by creating an Amazon Aurora MySQL Read Replica of a MySQL DB instance. When the replica lag between the MySQL DB instance and the Amazon Aurora MySQL Read Replica is 0, we can stop replication. Then we can make the Aurora Read Replica a standalone Amazon Aurora MySQL Database cluster for reading and writing.
In this case, Downtime will be minimum or zero as we will do the data syncing in Amazon aurora read replica before handing to the migration. After data is synced between RDS and Aurora read replica, we will change the endpoint in our source code and will make the Aurora read replica a standalone master database ( Exact downtime we can check in POC).
Data will be in sync with our current database.
Strategy 2:
Migrate from an RDS MySQL DB instance by creating an Amazon Aurora MySQL Read Replica of a MySQL DB instance. When the replica lag between the MySQL DB instance and the Amazon Aurora MySQL Read Replica is 0, we can stop replication. Then we can make the Aurora Read Replica a standalone Amazon Aurora MySQL Database cluster for reading and writing.
In this case, Downtime will be minimum or zero as we will do the data syncing in Amazon aurora read replica before handing to the migration. After data is synced between RDS and Aurora read replica, we will change the endpoint in our source code and will make the Aurora read replica a standalone master database ( Exact downtime we can check in POC).
Data will be in sync with our current database.

Migration Process:
Strategy 1:
Migration of complete DB from RDS MySQL to Amazon Aurora MySQL: Migration of complete database from RDS MySQL to Amazon Aurora MySQL.
Pros:
- Migration of all the tables in one shot will be easier and data size in not more than 30 GB so there will be less effort to migrate the complete database as compared to migrating the database in multiple phases.
Cons:
- Monitoring and testing of all the features on production would be required.
Strategy 2:
Migration in 2 phases:
Phase 1: Migration of core tables
Migration of core tables such as device,user,deviceAccount ,deviceBd,deviceBdHistory and userPushToken in phase 1
Phase 2: Migration of other remaining tables
Migration of other remaining tables such as all CFU tables,BBY tables etc in phase 2.
Pros:
- Monitoring of features will be easy.
- Risk will be minimized.
Cons :
- More effort will required for sanity testing and migration as migration will be done in multiple phase.
Table size in Aurora:
Amazon Aurora stores data using 16 KiB pages. Pages are grouped into tablespaces, which act as containers for tables and the associated indexes. By default, Aurora uses a separate tablespace for each table, or for each partition of a table if the table is partitioned. Most of what such a tablespace contains is the following data structures:
- The clustered index containing the table records, ordered by the primary key or unique key of the table. If neither key is available, an internal monotonically increasing row ID is used to identify and order the records.
- The secondary indexes of the table.
- Externally stored values for variable-length fields (BLOB, TEXT, VARCHAR, VARBINARY, and so on) that don’t fit in the clustered index record.
The table architecture preceding means there isn’t a fixed maximum number of rows that you can store in a given table. The maximum row number depends on a number of factors:
- The maximum number of unique values supported by your primary key or unique key choice. For example, if you use an unsigned INT data type for the primary key (a popular choice), your table supports a maximum of 2^32 or a little over 4.29 billion rows.
- The number and size of your secondary indexes.
- The amount of variable-length data that is stored either directly in the clustered index records, or on external pages.
- How effectively data pages are utilized.
Limitations of Aurora:
- Amazon Aurora does not currently offer Micro DB Instance support.
- The Amazon Aurora database engine is designed to be wire-compatible with MySQL 5.6 and 5.7 using the InnoDB storage engine currently.
- Amazon aurora does not support MyISAM.
MySQL drawback:
- MySQL can't use merge join or hash join -- two fundamental algorithms that have useful performance characteristics.That's pretty much the end of the story for many query workloads. It is trivial to show a reasonable query that is orders of magnitude faster with a merge join.
- Although MySQL is equipped to handle a virtually limitless volume of data, it has a troubling tendency to come grinding to a halt if it’s forced to deal with too many operations at a given time
- Transactions are not handled very efficiently.
- MySQL does not support a very large database size efficiently.
Comments
Post a Comment