This post was written by:
Nicolas De Rico: Oracle Cloud Solutions Engineer - MySQL
Sergio J Castro: Oracle Cloud Solutions Engineer - Networking
When an application reaches the maximum capabilities offered by Amazon Web Services (AWS) RDS, it is often recommended to migrate to the AWS Aurora service. However, Aurora is based on an older version of MySQL. Aurora still does not support MySQL 8.0, which was released in April 2018. Therefore, it may be difficult to port applications to Aurora, and later, out of Aurora because of its proprietary aspects.
Defy conventional wisdom by upgrading from RDS to MDS and access many benefits
Instead of migrating from RDS to Aurora and traveling back in time, developers can use the Oracle MySQL Database Service (MDS) to lower costs and improve performance, without foregoing the latest MySQL innovations. This video describes how this migration can be accomplished. The latest benchmarks using the newly released MySQL Database Service with HeatWave show significant performance improvements compared to Aurora and Redshift.
In addition, at the time of writing this article, MDS costs between a third and half the cost of RDS for a similar configuration. The MySQL Database Service, which runs on Oracle Cloud Infrastructure (OCI), can be used with applications in either OCI or AWS. This article discusses how to integrate the MySQL Database Service running on Oracle Cloud with applications running in AWS.
But first, a quick introduction to MDS. The Oracle MySQL Database Service is a fully managed DBaaS based on the latest release of MySQL 8.0 Enterprise Edition. This service is 100% developed and supported by the MySQL engineering team. MDS is available on compute instances that range from 1 OCPU (2 threads) and 1GB RAM all the way up to 64 OCPUs (128 threads) and 1024GB RAM. Oracle does not take the approach of a two-tiered segmented MySQL product line, unlike AWS RDS and Aurora. Just select the right MDS shape for the next level of performance.
For applications that execute analytical queries against MySQL and would benefit from extreme query performance, MDS offers an option called MySQL Database Service with HeatWave to greatly accelerate those queries. In order to always ensure best performance, MySQL analyzes each incoming query to determine whether to execute it with its traditional execution engine or with HeatWave. This process is fully transparent to the application and delivers light-speed execution. Benchmarking of TPC-H queries (400GB data set) shows a median 400x query execution speed improvement with no changes to any of the queries.
So, how to get applications running in AWS to work with this wonderful OCI MDS? Read on for the details…
We will setup a high-speed private Intercloud connection using a 1 Gbps FastConnect link between OCI and AWS. We will start by linking the two cloud providers using OCI’s FastConnect and AWS’ DirectConnect via Equinix, which is a Telecom partner to both OCI and AWS.
Setting up FastConnect has been documented many times. Mr. Castro co-wrote a blog post with an Equinix engineer, you can find the step-by-step post here. And you can find documentation on DirectConnect on the Equinix website here.
In the next paragraphs, we will build the following architecture diagram with OCI and AWS:
We will be using the Ashburn region for OCI, and the US-East-1 region (N. Virginia) for AWS. We will start by reviewing the Networking and FastConnect settings in OCI.
We have configured a Virtual Cloud Network with two subnets in different availability domains, one private and one public. The MySQL Database Service (MDS) will reside in the private one. The VCN CIDR range is 10.20.0.0/16 and the CIDR for the subnets are 10.20.30.0/24 for the public one, and 10.20.40.0/24 for the private one.
For this configuration, we are only using one route table. The AWS side is using a 192.168.0.0/16 CIDR range, the private IP of the demonstration MySQL client console in AWS address falls in this range. All traffic going to that range will get there via the Dynamic Routing Gateway (DRG).
The DRG, of course, hosts the FastConnect 1Gbps Circuit to AWS’s Direct Connect.
If you click on the circuit, you can view the BGP State:
Now let us view the AWS Networking and Direct Connect settings. As previously mentioned, the CIDR range for the Virtual Private Cloud (VPC) in Amazon Web Services is 126.96.36.199/16.
This VPC also has two subnets, one for layered services and another demonstration subnet for a potential RDS database candidate for migration to MDS. Their CIDR ranges are 192.168.0.0/24 and 192.168.199.0/24 respectively.
They are both associated with the same route table. The routes in the Route Table were advertised by OCI via the BGP session.
The Virtual Private Gateway (VGW) is the AWS equivalent to the DRG in OCI.
In the above image you can see that the VGW is attached to the VPC that we’re using to interconnect to OCI, and to Direct Connect. The ID string for this VPC is vpc-0fd882a938ce2c040. If you click on the Direct Connect Gateway link, it will take you to the Virtual Interface that details the Direct Connect configuration.
Now that we’ve seen the FastConnect / DirectConnect details, let us see the latency between an OCI Compute Instance on OCI and an EC2 Instance on AWS. Below you will find the details for both compute instances.
We can determine the network latency between the two public clouds. Pinging from 10.20.30.10 (OCI) to 192.168.0.101 (AWS) the average ping response time is 1.65 milliseconds!
Now that we have configured the Intercloud connectivity, all that remains for today is to create an MDS instance in OCI and connect to it from the AWS EC2 instance. The MySQL Database Service is a top-level item in the OCI Cloud Portal menu. A configured MDS instance will look like this:
We can see that MDS uses MySQL version 8.0.22. Newly created MDS instances will use the latest version of MySQL. We will connect to this MDS instance in OCI from our EC2 instance in AWS:
As we can see, it is very easy and convenient to connect applications from AWS to OCI and vice-versa when the Intercloud connectivity has been established. An application in AWS can point to an MDS instance in OCI by simply changing the IP address of the connection. It’s as if the OCI subnet resides in the AWS VPC!
But what about networking costs between the two clouds? Ingress is free both ways and, in OCI, the first 10TB/month egress is free. Applications running in AWS that cause high egress costs could simply be moved to OCI for costs savings and still be accessible from AWS. Additionally, MySQL has network compression options to minimize the network usage. The bandwidth of the Intercloud connection can be adjusted up or down to match the real-life workload, but the low latency should remain unchanged regardless of the bandwidth setting. With all these points, the Intercloud networking cost can be easily optimized and kept under control.
The MySQL Database service is developed and supported directly by the MySQL developers. It is always up-to-date and contains all the MySQL innovation and functionality. Built from the MySQL Enterprise Edition and on the Oracle Cloud Infrastructure, the MySQL Database Service offers unparalleled high performance and security for any critical data.
MySQL is a great cloud database technology because of its prevalence in public clouds and also on-premises. Applications can be written once for all deployment models! Although not covered in this present article, migrating databases from RDS to MDS should be quite simple because of the compatibility between these database systems. Database system choices can be made based on performance, criticality of support, costs, and so on, while avoiding hard lock-ins by using popular open source technologies.
We hope with this article that users of RDS who want more than RDS is capable will defy conventional wisdom and consider using the MySQL Database Service in OCI instead of other legacy and proprietary services in AWS. For an idea of the costs of the MySQL Database Service, here is a comparison with other public cloud MySQL services.
Annual cost for 100 OCPUs, 1TB Storage configuration
Configuration: 100 OCPUs, 1 TB Storage
|MySQL Database Service:||Standard E3 AMD 16GB/Core, all regions have the same price.|
|Amazon RDS:||Intel R5 16GB/Core, AWS US East.|
|Azure:||Memory Optimized Intel 20GB/Core, MS Azure US-East.|
|Google:||High Memory N1 Standard Intel 13GB/Core, GCP Northern Virginia.|
Thank you for visiting and for using MySQL!
Nicolas & Sergio