Migrating from an on-premises, self- hosted SQL database to AWS Relational Database (RDS) can be scary business. Migrating to AWS RDS is a chance to not only take care of issues your dealing with today, but also to plan for issues you anticipate.
- Choose your RDS featuresOnce steps 1 and 2 are completed, you can decide which AWS RDS features best suit your needs.Check out the table below to analyze your individual needs:
Problem Area AWS RDS Feature Description Checklist DR & HA AWS Multi-AZ Enable the Multi AZ feature for production databases to provide a synchronous “standby” replica of every database in a different availability zone. if one of the zones in a region goes down, RDS will serve your database requests from another zone. Since both the database and its replica are in sync, data loss is impossible. - Decide whether or not you need HA. Though it may be pricey, your production system could require it.
- If you are not using Multi-AZ, be sure to plan maintenance procedures carefully so as to prevent downtime and latency.
Backup & Restore AWS Snapshot & Point in Time Backup RPO and RTO are critical factors for any HA system, and require appropriate backup and restore operations. AWS RDS provides two distinct backup mechanisms that can restore data from either a specific point in time (snapshot) or up to the last 5 minutes of operations (automated backup). - Select an RTP & RTO.
- If automated backup does not meet your requirements, plan on setting up frequent snapshots as well as HA with Multi AZ.
- Plan your snapshots when data is stable.
Security VPC, Security Group, SSL Security is key when you are migrating to cloud-based databases. Thankfully, AWS provides VPC, which launches databases in private subnets for secure access.RDS also supports SSL and AWS provides a virtual firewall with security groups. - Be sure to set up VPC for secure database access.
- Choose which IPs (application / organization access) to connect to RDS.
- Open ports in the appropriate security groups.
- If needed, set up SSL for RDS.
Monitoring CloudWatch AWS provides multiple metrics for monitoring with Cloudwatch.Using AWS SNS with Cloudwatch provides you with alert notifications. - Set up alarms and notifications for metrics, such as high CPU utilization, low disk space, and high database connections.
- Leverage AWS database event notifications to get alerts on certain RDS events, such as backup, availability, configuration changes and many more.
Access Control IAM with RDS Identity and access management (IAM) allows segregation of duties and it’s an important way to enforce security.If you want to create policies to limit AWS RDS access, create IAM users/groups and define respective policies. - Calculate the amount of users that will access RDS.
- Verify the types of access that will be needed.
- Create a policy for each type of access.
Audit Trail AWS CloudTrail AWS CloudTrail logs all API calls to AWS RDS. - Decide where to store API logs.
- Review the CloudTrail log format to analyze your data.
Performance IOPS, Instance Sizes Production databases constantly require faster performance with lower latency. Therefore, RDS provides configured IOPS rates and storage for the lifetime of your DB instance.RDS instance sizes also have varying performance. Larger sizes yield better I/O, which translates into higher throughput and lower latency. - Decide on an appropriate instance size based on your workload.
- Select a disk size.
- Choose an application load, database size and database page size.
- Based on the steps above, select an adequate number of IOPS.
Scaling Read Replica + Data Partitioning with ScaleBase Web scale is one of the core challenges for cloud databases these days. With RDS, it is easy to scale up (vertical scaling) but not easy to scale out (horizontal scaling).If you only have read only requests, you can use Read Replicas to scale out. However real database scale can only be achieved by horizontally scaling out (sometimes called sharding) the database.If you decide to scale out on your own, you need to factor in test and shard code management overhead. An easier option is to leverage ScalaBase AWS software. It automatically partitions your data without any modification to your apps. And each partition can still have read-replicas associated with it. - Identify if you need a read only DB.
- Create read replicas in separate regions/zones.
- The best option is to use ScaleBase (on AWS Marketplace) to manage elasticity and automated scale out a single RDS database instance into multiple database instances that work together to act as a single database. Learn more.
Cost Reserved Instances Cost optimization influences every company. Consequently, RDS provides reserved instances to help lower costs.Note: if you partition your database (see Scaling above), you can use smaller and less expensive instances working together to obtain more compute power than is available from a single larger (and more expensive) instance. - Select a utilization period for your RIs (i.e. 1 year, 3 years, etc…). Be sure to keep the cost optimization factor in mind.
DB Engine Configuration AWS RDS Parameter Group The AWS RDS parameter group allows you to perform DB engine configurations. Think of it like a container for your database engine that can be applied to one or more RDS database instances. Note that AWS does not allow changes to be made to all parameters. - RDS has a default parameter group created for database engines. If needed, you can modify many of the parameters, such as “max_allowed_packet”, “log-error” and many more.
- Remember that the default RDS parameter group is set for optimized database performance. If you do not modify it correctly, it may result in lowered database performance.
Caching AWS RDS Option Group You can use an option group based on your engine’s configuration. Option settings control the behavior of an option. For example, Amazon RDS supports using the memcached interface with InnoDB tables. MySQL 5.6 introduced a plugin that implements a daemon service which exposes the data from InnoDB tables through thememcached protocol. It serves as an in-memory caching layer.The memcached API enables applications to use InnoDB tables in a manner similar to NoSQL key-value data stores. - Here if you are adding the memcached option group for RDS, you need to decide which columns in your MySQL tables can be accessed through the memcached interface.
- The memcached plugin creates a catalog table named ‘containers’ in a dedicated database named ‘Innodb_memcache’.
- You can insert a row into the ‘containers’ table to map an InnoDB table to access through memcached.
Once all of the above factors are considered, launch an RDS database instance based on your selected configurations and parameters. Import data from your on-premises SQL database to your RDS instance.