Aurora Serverless tamed for Developers (faster time to market)

AWS Aurora Serverless is a good option for Development and unpredictable workload. However, Aurora Serverless doesn’t have a public endpoint. This means that a development team has to access DB from an EC2 instance on the same VPC. We found a way around.

Background

We use Aurora Serverless frequently for development and production environments for startups and large corporations. While Aurora Provisioned can have public endpoint that can be directly accessed by tools such as MySQL Workbench and can be mapped to localhost environment for developer, there is no such provision for Serverless DB. While resolving this issue, we discovered two alternatives.

  1. Install phpMyAdmin
  2. Load Balancer before DB

While we are specifically talking about MySQL DB, however, the similar approach may be used for Postgresql as well.

Install phpMyAdmin

If we install phpMyAdmin on a EC2 VM on the same VPC where our DB is then Developers can get a ready-made graphical view of the DB. The machine need not be on public subnet and can even be behind a Load Balancer. This is more secure option, however, this option doesn’t let Developers use localhost to connect server data. Developers can still create a dump of database and load on their local machine.

Setup

  1. Provision an EC2 instance on VPC
  2. Install nginx on this instance

    amazon-linux-extras install nginx1 php7.2 -y

  3. Download latest version of phpMyAdmin, unzip, rename to phpMyAdmin and place at /usr/share/nginx/html (root folder of nginx)
  4. Access <nginxURL>/phpMyAdmin/setup
  5. Configure DB details and download setup instructions
  6. Create or update config.inc.php file
  7. Login using your DB credentials

Load Balancer before DB

If we install Load Balancer (nginx) on public subnet EC2 VM on the same VPC that redirects our requests to DB then that’s a bingo. Now, Development team can access Aurora Serverless DB using Elastic IP of the EC2 VM. This is preferred option for developers because DB can be directly mapped to localhost for development and debugging. This may be safe approach also because DB dump is not distributed on Developers’ machines.

Setup

  1. Provision an EC2 instance on VPC
  2. Install nginx on this instance

    amazon-linux-extras install nginx1 -y

  3. Configure proxy setting to point traffic to your DB box

stream {
server {
listen 3306;
proxy_pass your-db-endpoint.rds.amazonaws.com:3306;
}
}

Back to you

Do you use AWS Aurora Serverless for your Development or Production Workload? How do you make your DB available to Developers for faster time to market? Please write in comments.

About VisionFirst Technologies Pvt. Ltd.

We are a group of researchers and practitioners of cutting edge technology. We are AWS Select Consulting Partner. Our tech stack includes Serverless apps, Big Data Pipeline, Machine Learning, offline/2G tolerant mobile apps, web applications, IOT and Analytics. Please contact us to know how we may help you.

Add a Comment

Your email address will not be published.

Related Blogs