This post is part of our complete guide: How to Build a Serverless Application on AWS using Ruby
Aurora Serverless is a Serverless Relational Database Service that eliminates the need to manage the instances or the capacity of your relational database. Its a very good choice if you are not a seasoned database pro. However, it should be understood that it does not qualify for the free tier. So you need to be aware of the pricing if you want to use this in production.
Later in this guide we will show our example in DynamoDB. Dynamo does have free tier options, but the tradeoff is a NoSQL database that may or may not make sense for your situation.
We wanted to be thorough so we are going to show both. This way you have the knowledge to make the best decision for your application.
Use the N. Virginia Region (us-east-1)
You will want to create your cluster in the North Virginia region (us-east-1). Why? Because right now that’s the only region you can use the Query Editor built into the console! An Aurora Serverless Cluster has no public access so its very useful to be able to query the cluster without having to jump on an EC2 in the same instance etc.
So before you get started on the steps below, choose N. Virgina for your region.
Create an Aurora Serverless Cluster
Go to the RDS Console, and click Create database
If you already have database instances then your console will look like this:
Choose Aurora, and click Next
Choose Serverless and enter the following values:
- DB cluster identifer:
- Master username:
- Master password: choose a password
- Click Next
Set the minimum and maximum capacities to 2 and enter the following values:
- Virtual Private Cloud (VPC): Choose Create new VPC
- Subnet group: Choose Create new DB Subnet Group
- Click Create database
After a short wait your Aurora Serverless Cluster will be Available and ready to use!
Next, let’s create an AWS Lambda using Ruby and Active Record to use this cluster.