Usecase Article Details

Migrating an SQL Database on an EC2 to Amazon RDS

Amazon Web Services offers customers the ability to deploy their cloud infrastructure in diverse ways. Customers must carefully consider their specific business case and establish infrastructure which delivers value to their end users in the most cost-efficient way. The various features of AWS technologies provide just the perfect premise for this objective to be realized.

Our client had their inventory application which processes a lot of database queries on an hourly and daily basis hosted in the AWS cloud on an EC2 instance. As a result of the frequent rate at which data is queried from the database, our client wanted to migrate all their database to Amazon Relational Database Service (RDS).

Our solution was to deploy an architecture that hosts the client`s web application on their EC2 instance but points to AWS RDS MySQL data server.

The Client`s current architecture

 

Considering the Client`s current architecture, it is a less pragmatic way of implementing a reliable solution to this specific business need; the frequent querying of data in the most economic way.

Why change this current architecture?

  • It is self-managed.
  • Redundancy is reduced.
  • Operational costs are relatively higher.
  • Less secure

To satisfy the specific business need, a more appropriate architecture had to be deployed to replace the existing one.

The Ideal Architecture

This architecture deploys the database on a separate instance i.e., and RDS instance. The EC2 instance which hosts the web application server points to the RDS instance as its database. This new architecture is deployed in a VPC with the RDS instance in a private subnet because of security considerations and the EC2 instance hosting the web server in a public subnet making it public facing.

This new architecture equips the client with the following benefits:

  • It is highly available and redundant.
  • It is AWS managed.
  • It is scalable.
  • It is cost-efficient.
  • It has strong security.

THE SOLUTION STEPS

  1. Create a subnet group in the VPC of the already existing EC2 instance.
  2. Create an RDS instance in the specified subnet group.
  3. Export and clone the web application files from its repository to the web server on the EC2.
  4. Connect the RDS DB instance to the EC2 instance using the connection string of the DB instance.
  5. Add the main application file to the root directory of the web server on the EC2 instance.

Learn more on Virtual Employment by attending in one of our Webinars

Sign-up to see open webinar slots